<?php
namespace App\Entity;
use App\Repository\StaffProfileRepository;
use Doctrine\Common\Collections\{ArrayCollection, Collection};
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Symfony\Component\Validator\Constraints as Assert;
#[ORM\Entity(repositoryClass: StaffProfileRepository::class), ORM\Table(name: 'staff_profiles')]
class StaffProfile implements \Stringable
{
#[ORM\Id, ORM\GeneratedValue, ORM\Column(type: 'integer')]
private $id;
#[ORM\Column(type: 'string', length: 100), Assert\NotBlank]
#[Assert\Regex(pattern: '/^[a-zA-Z]+$/i', message: 'Your first name cannot contain a number')]
#[Assert\Length(
min: 2,
max: 15,
minMessage: 'Your first name must be at least {{ limit }} characters long',
maxMessage: 'Your first name cannot be longer than {{ limit }} characters'
)]
private $firstName;
#[ORM\Column(type: 'string', length: 100), Assert\NotBlank]
#[Assert\Regex(pattern: '/^[a-zA-Z]+$/i', message: 'Your last name cannot contain a number')]
#[Assert\Length(
min: 2,
max: 15,
minMessage: 'Your last name must be at least {{ limit }} characters long',
maxMessage: 'Your last name cannot be longer than {{ limit }} characters'
)]
private $lastName;
#[ORM\Column(type: 'string', length: 100), Assert\NotBlank]
#[Assert\Regex(pattern: '/^[a-zA-Z ]+$/i', message: 'Your father name cannot contain a number')]
#[Assert\Length(
min: 1,
max: 15,
minMessage: 'Your father name must be at least {{ limit }} characters long',
maxMessage: 'Your father name cannot be longer than {{ limit }} characters'
)]
private $fatherName;
#[ORM\Column(type: 'string', length: 100, nullable: true)]
#[Assert\Regex(pattern: '/^[a-zA-Z ]+$/i', message: 'Your mother name cannot contain a number')]
#[Assert\Length(
min: 2,
max: 15,
minMessage: 'Your mother name must be at least {{ limit }} characters long',
maxMessage: 'Your mother name cannot be longer than {{ limit }} characters'
)]
private $motherName;
#[ORM\Column(type: 'string', columnDefinition: "enum('Male', 'Female', 'Other')"), Assert\NotBlank]
private $gender;
#[ORM\Column(type: 'string', length: 100)]
private $photo;
#[ORM\Column(type: 'text'), Assert\NotBlank]
private $localAddress;
#[ORM\Column(type: 'text'), Assert\NotBlank]
private $permanentAddress;
#[ORM\Column(type: 'date'), Assert\NotBlank]
private $dob;
#[ORM\Column(type: 'date', nullable: true)]
private $dor;
#[ORM\Column(type: 'integer', nullable: true)]
private $email_otp_verify;
#[ORM\Column(type: 'integer', nullable: true)]
private $mobile_otp_verify;
#[ORM\Column(type: 'string', length: 12)]
#[Assert\Regex(pattern: '/^[0-9]*$/', message: 'Aadhaar number must be in positive number')]
#[Assert\Length(min: 12, max: 12, exactMessage: 'Aadhaar number must be of {{ limit }} characters.')]
private $adharNum;
#[ORM\Column(type: 'string', length: 10)]
#[Assert\Length(min: 10, max: 10, exactMessage: 'PAN Number must be of {{ limit }} characters.')]
private $panNum;
#[ORM\Column(type: 'string', length: 190), Assert\Email]
private $email;
#[ORM\Column(type: 'string', length: 190), Assert\Email]
private $temp_email;
#[Assert\Regex(pattern: '/^[0-9]*$/')]
#[ORM\Column(type: 'string', length: 10, nullable: true)]
private $temp_mobile_no;
#[ORM\Column(type: 'integer', length: 6, nullable: true)]
private $email_otp;
#[ORM\Column(type: 'string', length: 10), Assert\NotBlank]
#[Assert\Regex(pattern: '/^[0-9]*$/', message: 'Mobile number must be in positive number')]
private $mobile;
#[ORM\Column(type: 'integer', length: 6, nullable: true)]
private $mobile_otp;
#[ORM\Column(type: 'string', length: 15, nullable: true)]
private $empSenNum;
#[ORM\Column(type: 'string', length: 50, nullable: true)]
private $gpfCpfNum;
#[ORM\Column(type: 'string', length: 50, nullable: true)]
private $contractNum;
#[ORM\Column(type: 'string', length: 50, nullable: true)]
private $is_update;
/* #[ORM\Column(type: 'string', columnDefinition: "enum('General', 'ST', 'SC', 'OBC', 'SEBC', 'Nt-b', 'Nt-d')")]
#[Assert\NotBlank]
private $castCategory; */
#[ORM\Column(type: 'string', columnDefinition: "enum('None', 'ST', 'SC', 'PH', 'Women', 'Ex-Army')"), Assert\NotBlank]
private $quotaType;
#[ORM\Column(type: 'string', columnDefinition: "enum('Permanent', 'Contractual', 'Temporary', 'Outsourced')")]
#[Assert\NotBlank]
private $jobType;
#[ORM\Column(type: 'string', length: 50), Assert\NotBlank]
#[Assert\Length(
min: 3,
max: 25,
minMessage: 'Bank name must be at least {{ limit }} characters long',
maxMessage: 'Bank name cannot be longer than {{ limit }} characters'
)]
#[Assert\Regex(pattern: '/^[A-Za-z ]+$/i', message: 'Bank name invalid format.')]
private $bankName;
#[ORM\Column(type: 'string', length: 50), Assert\NotBlank]
#[Assert\Length(
min: 3,
max: 30,
minMessage: 'Bank Branch name must be at least {{ limit }} characters long',
maxMessage: 'Bank Branch name cannot be longer than {{ limit }} characters'
)]
#[Assert\Regex(pattern: '/^[A-Za-z ]/', message: 'Branch name invalid format.')]
private $bankBranch;
#[ORM\Column(type: 'text', nullable: true)]
private $bankBranchAddress;
#[ORM\Column(type: 'string', length: 50), Assert\NotBlank]
#[Assert\Length(
min: 6,
max: 25,
minMessage: 'Account no. must be at least {{ limit }} number long',
maxMessage: 'Account no. cannot be longer than {{ limit }} number'
)]
#[Assert\Regex(pattern: '/^[0-9]*$/', message: 'Account number must be in positive number')]
private $bankAccount;
#[ORM\Column(type: 'string', length: 25), Assert\NotBlank]
private $bankIfsCode;
#[ORM\OneToOne(targetEntity: User::class, mappedBy: 'profile', cascade: ['persist', 'remove'])]
private $user;
#[ORM\ManyToOne(targetEntity: Hospital::class), ORM\JoinColumn(nullable: false)]
private $hospital;
#[ORM\ManyToOne(targetEntity: DoctorCategory::class)]
private $doctorCategory;
#[ORM\ManyToOne(targetEntity: Ward::class)]
private $ward;
#[ORM\ManyToOne(targetEntity: DesignationSetting::class)]
#[ORM\JoinColumn(name: 'designation_setting_id', nullable: false), Assert\NotBlank]
private $designation;
#[ORM\Column(type: 'string', length: 50, nullable: true)]
private $regNum;
#[Gedmo\Timestampable(on: 'create'), ORM\Column(type: 'datetime')]
private $createdAt;
#[Gedmo\Timestampable(on: 'create'), ORM\Column(type: 'datetime')]
private $updatedAt;
#[ORM\OneToMany(targetEntity: StaffServiceOrder::class, mappedBy: 'profile', orphanRemoval: true)]
private $serviceOrders;
#[ORM\OneToMany(targetEntity: StaffEducation::class, mappedBy: 'profile', orphanRemoval: true)]
private $education;
#[ORM\OneToMany(targetEntity: StaffFamilyMember::class, mappedBy: 'profile', orphanRemoval: true)]
private $familyMembers;
#[ORM\OneToMany(targetEntity: StaffWorkExperience::class, mappedBy: 'profile', orphanRemoval: true)]
private $workExperiences;
#[ORM\OneToMany(targetEntity: StaffTraining::class, mappedBy: 'profile', orphanRemoval: true)]
private $trainings;
#[ORM\OneToMany(targetEntity: StaffSalaryHistory::class, mappedBy: 'profile', orphanRemoval: true)]
private $salaryHistories;
#[ORM\OneToMany(targetEntity: StaffDeputation::class, mappedBy: 'profile', orphanRemoval: true)]
private $deputations;
#[ORM\OneToMany(targetEntity: StaffComplaint::class, mappedBy: 'profile', orphanRemoval: true)]
private $complaints;
#[ORM\OneToMany(targetEntity: StaffLeaveAllotment::class, mappedBy: 'profile', orphanRemoval: true)]
private $leaveAllotments;
public function __construct()
{
$this->serviceOrders = new ArrayCollection();
$this->education = new ArrayCollection();
$this->familyMembers = new ArrayCollection();
$this->workExperiences = new ArrayCollection();
$this->trainings = new ArrayCollection();
$this->salaryHistories = new ArrayCollection();
$this->deputations = new ArrayCollection();
$this->complaints = new ArrayCollection();
$this->leaveAllotments = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getFirstName(): ?string
{
return $this->firstName;
}
public function setFirstName(string $firstName): self
{
$this->firstName = strip_tags($firstName);
return $this;
}
public function getLastName(): ?string
{
return $this->lastName;
}
public function setLastName(string $lastName): self
{
$this->lastName = strip_tags($lastName);
return $this;
}
public function getFatherName(): ?string
{
return $this->fatherName;
}
public function setFatherName(string $fatherName): self
{
$this->fatherName = strip_tags($fatherName);
return $this;
}
public function getMotherName(): ?string
{
return $this->motherName;
}
public function setMotherName(?string $motherName): self
{
$this->motherName = strip_tags($motherName);
return $this;
}
public function getGender(): ?string
{
return $this->gender;
}
public function setGender(?string $gender): self
{
$this->gender = $gender;
return $this;
}
public function getPhoto(): ?string
{
return $this->photo;
}
public function setPhoto(?string $photo): self
{
$this->photo = $photo;
return $this;
}
public function getLocalAddress(): ?string
{
return $this->localAddress;
}
public function setLocalAddress(?string $localAddress): self
{
$this->localAddress = strip_tags($localAddress);
return $this;
}
public function getPermanentAddress(): ?string
{
return $this->permanentAddress;
}
public function setPermanentAddress(?string $permanentAddress): self
{
$this->permanentAddress = strip_tags($permanentAddress);
return $this;
}
public function getDob(): ?\DateTimeInterface
{
return $this->dob;
}
public function setDob(\DateTimeInterface $dob): self
{
$this->dob = $dob;
return $this;
}
public function getDor(): ?\DateTimeInterface
{
return $this->dor;
}
public function setDor(?\DateTimeInterface $dor): self
{
$this->dor = $dor;
return $this;
}
public function getAdharNum(): ?string
{
return $this->adharNum;
}
public function setAdharNum(string $adharNum): self
{
$this->adharNum = $adharNum;
return $this;
}
public function getPanNum(): ?string
{
return $this->panNum;
}
public function setPanNum(string $panNum): self
{
$this->panNum = $panNum;
return $this;
}
public function getEmail(): ?string
{
return $this->email;
}
public function getTempEmail(): ?string
{
return $this->temp_email;
}
public function getEmailOTP(): ?int
{
return $this->email_otp;
}
public function getEmailOTPVerify(): ?int
{
return $this->email_otp_verify;
}
public function setEmail(string $email): self
{
$this->email = $email;
return $this;
}
public function setEmailOTP(int $email_otp): self
{
$this->email_otp = $email_otp;
return $this;
}
public function setEmailOTPVerify(int $email_otp_verify): self
{
$this->email_otp_verify = $email_otp_verify;
return $this;
}
public function getMobile(): ?string
{
return $this->mobile;
}
public function getTempMobile(): ?string
{
return $this->temp_mobile_no;
}
public function setMobile(string $mobile): self
{
$this->mobile = $mobile;
return $this;
}
public function setMobileOTP(int $mobile_otp): self
{
$this->mobile_otp = $mobile_otp;
return $this;
}
public function setTempMobile(int $temp_mobile_no): self
{
$this->temp_mobile_no = $temp_mobile_no;
return $this;
}
public function getMobileOTPVerify(): ?int
{
return $this->mobile_otp_verify;
}
public function getMobileOTP(): ?int
{
return $this->mobile_otp;
}
public function setMobileOTPVerify(): ?int
{
return $this->mobile_otp_verify;
}
public function getEmpSenNum(): ?string
{
return $this->empSenNum;
}
public function setEmpSenNum(string $empSenNum): self
{
$this->empSenNum = $empSenNum;
return $this;
}
public function getGpfCpfNum(): ?string
{
return $this->gpfCpfNum;
}
public function setGpfCpfNum(string $gpfCpfNum): self
{
$this->gpfCpfNum = $gpfCpfNum;
return $this;
}
public function getContractNum(): ?string
{
return $this->contractNum;
}
public function setContractNum(string $contractNum): self
{
$this->contractNum = $contractNum;
return $this;
}
public function getIsUpdate(): ?string
{
return $this->is_update;
}
public function setIsUpdate(string $is_update): self
{
$this->is_update = $is_update;
return $this;
}
/* public function getCastCategory(): ?string
{
return $this->castCategory;
}
public function setCastCategory(string $castCategory): self
{
$this->castCategory = $castCategory;
return $this;
} */
public function getQuotaType(): ?string
{
return $this->quotaType;
}
public function setQuotaType(string $quotaType): self
{
$this->quotaType = $quotaType;
return $this;
}
public function getJobType(): ?string
{
return $this->jobType;
}
public function setJobType(string $jobType): self
{
$this->jobType = $jobType;
return $this;
}
public function getBankName(): ?string
{
return $this->bankName;
}
public function setBankName(string $bankName): self
{
$this->bankName = strip_tags($bankName);
return $this;
}
public function getBankBranch(): ?string
{
return $this->bankBranch;
}
public function setBankBranch(string $bankBranch): self
{
$this->bankBranch = strip_tags($bankBranch);
return $this;
}
public function getBankBranchAddress(): ?string
{
return $this->bankBranchAddress;
}
public function setBankBranchAddress(string $bankBranchAddress): self
{
$this->bankBranchAddress = strip_tags($bankBranchAddress);
return $this;
}
public function getBankAccount(): ?string
{
return $this->bankAccount;
}
public function setBankAccount(string $bankAccount): self
{
$this->bankAccount = $bankAccount;
return $this;
}
public function getBankIfsCode(): ?string
{
return $this->bankIfsCode;
}
public function setBankIfsCode(string $bankIfsCode): self
{
$this->bankIfsCode = strip_tags($bankIfsCode);
return $this;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(User $user): self
{
$this->user = $user;
if ($user->getProfile() !== $this) {
$user->setProfile($this);
}
return $this;
}
public function getHospital(): ?Hospital
{
return $this->hospital;
}
public function setHospital(Hospital $hospital): self
{
$this->hospital = $hospital;
return $this;
}
public function getDoctorCategory(): ?DoctorCategory
{
return $this->doctorCategory;
}
public function setDoctorCategory(?DoctorCategory $doctorCategory): self
{
$this->doctorCategory = $doctorCategory;
return $this;
}
public function getWard(): ?Ward
{
return $this->ward;
}
public function setWard(?Ward $ward): self
{
$this->ward = $ward;
return $this;
}
public function getDesignation(): ?DesignationSetting
{
return $this->designation;
}
public function setDesignation(DesignationSetting $designation): self
{
$this->designation = $designation;
return $this;
}
public function getRegNum(): ?string
{
return $this->regNum;
}
public function setRegNum(string $regNum): self
{
$this->regNum = $regNum;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updatedAt;
}
public function getFullName()
{
return $this->getFirstName() . ' ' . $this->getLastName();
}
/**
* @return Collection|StaffServiceOrder[]
*/
public function getServiceOrders(): Collection
{
return $this->serviceOrders;
}
public function addServiceOrder(StaffServiceOrder $serviceOrder): self
{
if (!$this->serviceOrders->contains($serviceOrder)) {
$this->serviceOrders[] = $serviceOrder;
$serviceOrder->setProfile($this);
}
return $this;
}
public function removeServiceOrder(StaffServiceOrder $serviceOrder): self
{
if ($this->serviceOrders->contains($serviceOrder)) {
$this->serviceOrders->removeElement($serviceOrder);
if ($serviceOrder->getProfile() === $this) {
$serviceOrder->setProfile(null);
}
}
return $this;
}
/**
* @return Collection|StaffEducation[]
*/
public function getEducation(): Collection
{
return $this->education;
}
public function addEducation(StaffEducation $education): self
{
if (!$this->education->contains($education)) {
$this->education[] = $education;
$education->setProfile($this);
}
return $this;
}
public function removeEducation(StaffEducation $education): self
{
if ($this->education->contains($education)) {
$this->education->removeElement($education);
if ($education->getProfile() === $this) {
$education->setProfile(null);
}
}
return $this;
}
/**
* @return Collection|StaffFamilyMember[]
*/
public function getFamilyMembers(): Collection
{
return $this->familyMembers;
}
public function addFamilyMember(StaffFamilyMember $familyMember): self
{
if (!$this->familyMembers->contains($familyMember)) {
$this->familyMembers[] = $familyMember;
$familyMember->setProfile($this);
}
return $this;
}
public function removeFamilyMember(StaffFamilyMember $familyMember): self
{
if ($this->familyMembers->contains($familyMember)) {
$this->familyMembers->removeElement($familyMember);
if ($familyMember->getProfile() === $this) {
$familyMember->setProfile(null);
}
}
return $this;
}
/**
* @return Collection|StaffWorkExperience[]
*/
public function getWorkExperiences(): Collection
{
return $this->workExperiences;
}
public function addWorkExperience(StaffWorkExperience $workExperience): self
{
if (!$this->workExperiences->contains($workExperience)) {
$this->workExperiences[] = $workExperience;
$workExperience->setProfile($this);
}
return $this;
}
public function removeWorkExperience(StaffWorkExperience $workExperience): self
{
if ($this->workExperiences->contains($workExperience)) {
$this->workExperiences->removeElement($workExperience);
if ($workExperience->getProfile() === $this) {
$workExperience->setProfile(null);
}
}
return $this;
}
/**
* @return Collection|StaffTraining[]
*/
public function getTrainings(): Collection
{
return $this->trainings;
}
public function addTraining(StaffTraining $training): self
{
if (!$this->trainings->contains($training)) {
$this->trainings[] = $training;
$training->setProfile($this);
}
return $this;
}
public function removeTraining(StaffTraining $training): self
{
if ($this->trainings->contains($training)) {
$this->trainings->removeElement($training);
if ($training->getProfile() === $this) {
$training->setProfile(null);
}
}
return $this;
}
/**
* @return Collection|StaffSalaryHistory[]
*/
public function getSalaryHistories(): Collection
{
return $this->salaryHistories;
}
public function addSalaryHistory(StaffSalaryHistory $salaryHistory): self
{
if (!$this->salaryHistories->contains($salaryHistory)) {
$this->salaryHistories[] = $salaryHistory;
$salaryHistory->setProfile($this);
}
return $this;
}
public function removeSalaryHistory(StaffSalaryHistory $salaryHistory): self
{
if ($this->salaryHistories->contains($salaryHistory)) {
$this->salaryHistories->removeElement($salaryHistory);
if ($salaryHistory->getProfile() === $this) {
$salaryHistory->setProfile(null);
}
}
return $this;
}
/**
* @return Collection|StaffDeputation[]
*/
public function getDeputations(): Collection
{
return $this->deputations;
}
public function addDeputation(StaffDeputation $deputation): self
{
if (!$this->deputations->contains($deputation)) {
$this->deputations[] = $deputation;
$deputation->setProfile($this);
}
return $this;
}
public function removeDeputation(StaffDeputation $deputation): self
{
if ($this->deputations->contains($deputation)) {
$this->deputations->removeElement($deputation);
if ($deputation->getProfile() === $this) {
$deputation->setProfile(null);
}
}
return $this;
}
/**
* @return Collection|StaffComplaint[]
*/
public function getComplaints(): Collection
{
return $this->complaints;
}
public function addComplaint(StaffComplaint $complaint): self
{
if (!$this->complaints->contains($complaint)) {
$this->complaints[] = $complaint;
$complaint->setProfile($this);
}
return $this;
}
public function removeComplaint(StaffComplaint $complaint): self
{
if ($this->complaints->contains($complaint)) {
$this->complaints->removeElement($complaint);
if ($complaint->getProfile() === $this) {
$complaint->setProfile(null);
}
}
return $this;
}
/**
* @return Collection|StaffLeaveAllotment[]
*/
public function getLeaveAllotments(): Collection
{
return $this->leaveAllotments;
}
public function addLeaveAllotment(StaffLeaveAllotment $leaveAllotment): self
{
if (!$this->leaveAllotments->contains($leaveAllotment)) {
$this->leaveAllotments[] = $leaveAllotment;
$leaveAllotment->setProfile($this);
}
return $this;
}
public function removeLeaveAllotment(StaffLeaveAllotment $leaveAllotment): self
{
if ($this->leaveAllotments->contains($leaveAllotment)) {
$this->leaveAllotments->removeElement($leaveAllotment);
if ($leaveAllotment->getProfile() === $this) {
$leaveAllotment->setProfile(null);
}
}
return $this;
}
public function __toString(): string
{
return $this->getFullName();
}
}