<?php
namespace App\Entity;
use App\Repository\ChildRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity(repositoryClass=ChildRepository::class)
* @ORM\HasLifecycleCallbacks()
*/
class Child
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $nameOfTheChild;
/**
* @ORM\Column(type="datetime")
*/
private $dateOfBirth;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $placeOfBirth;
/**
* @ORM\Column(type="string", length=255)
*/
private $sex;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $nameOfTheFather;
/**
* @ORM\Column(type="string", length=255,nullable=true)
*/
private $fatherSProfession;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $fatherSResidence;
/**
* @ORM\Column(type="date",nullable=true)
*/
private $fathersDateOfBirth;
/**
* @ORM\Column(type="string", length=255,nullable=true)
*/
private $fathersPlaceOfBirth;
/**
* @ORM\Column(type="string", length=255)
*/
private $nameOfTheMother;
/**
* @ORM\Column(type="string", length=255,nullable=true)
*/
private $motherSResidence;
/**
* @ORM\Column(type="date",nullable=true)
*/
private $motherSDateOfBirth;
/**
* @ORM\Column(type="string", length=255,nullable=true)
*/
private $motherSPlaceOfBirth;
/**
* @ORM\Column(type="string", length=255,nullable=true)
*/
private $motherSProfession;
/**
* @ORM\ManyToOne(targetEntity=Hospital::class, inversedBy="Children")
*/
private $hospital;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $fatherSEmail;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $motherSEmail;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $firstWitness;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $secondWitness;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $otherContact;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $updateAt;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $fatherContact;
/**
* @ORM\Column(type="string", length=255,nullable=true)
*/
private $motherContact;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $firstWitnessNic;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $secondWitnessNic;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $firstWitnessPhoneNumber;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*
*/
private $secondWitnessPhoneNumber;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $fatherNic;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $motherNic;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $birthDeclarationFile;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $marriageCertificate;
/**
* @ORM\ManyToOne(targetEntity=User::class, inversedBy="children")
*/
private $user;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $officerValidation1;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $officerValidation2;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $secretaryValidation;
public function getId(): ?int
{
return $this->id;
}
public function getNameOfTheChild(): ?string
{
return $this->nameOfTheChild;
}
public function setNameOfTheChild(?string $nameOfTheChild): self
{
$this->nameOfTheChild = $nameOfTheChild;
return $this;
}
public function getDateOfBirth(): ?\DateTimeInterface
{
return $this->dateOfBirth;
}
public function setDateOfBirth(\DateTimeInterface $dateOfBirth): self
{
$this->dateOfBirth = $dateOfBirth;
return $this;
}
public function getPlaceOfBirth(): ?string
{
return $this->placeOfBirth;
}
public function setPlaceOfBirth(?string $placeOfBirth): self
{
$this->placeOfBirth = $placeOfBirth;
return $this;
}
public function getSex(): ?string
{
return $this->sex;
}
public function setSex(string $sex): self
{
$this->sex = $sex;
return $this;
}
public function getNameOfTheFather(): ?string
{
return $this->nameOfTheFather;
}
public function setNameOfTheFather(?string $nameOfTheFather): self
{
$this->nameOfTheFather = $nameOfTheFather;
return $this;
}
public function getFatherSProfession(): ?string
{
return $this->fatherSProfession;
}
public function setFatherSProfession(?string $fatherSProfession): self
{
$this->fatherSProfession = $fatherSProfession;
return $this;
}
public function getFatherSResidence(): ?string
{
return $this->fatherSResidence;
}
public function setFatherSResidence(?string $fatherSResidence): self
{
$this->fatherSResidence = $fatherSResidence;
return $this;
}
public function getFathersDateOfBirth(): ?\DateTimeInterface
{
return $this->fathersDateOfBirth;
}
public function setFathersDateOfBirth(?\DateTimeInterface $fathersDateOfBirth): self
{
$this->fathersDateOfBirth = $fathersDateOfBirth;
return $this;
}
public function getFathersPlaceOfBirth(): ?string
{
return $this->fathersPlaceOfBirth;
}
public function setFathersPlaceOfBirth(?string $fathersPlaceOfBirth): self
{
$this->fathersPlaceOfBirth = $fathersPlaceOfBirth;
return $this;
}
public function getNameOfTheMother(): ?string
{
return $this->nameOfTheMother;
}
public function setNameOfTheMother(string $nameOfTheMother): self
{
$this->nameOfTheMother = $nameOfTheMother;
return $this;
}
public function getMotherSResidence(): ?string
{
return $this->motherSResidence;
}
public function setMotherSResidence(?string $motherSResidence): self
{
$this->motherSResidence = $motherSResidence;
return $this;
}
public function getMotherSDateOfBirth(): ?\DateTimeInterface
{
return $this->motherSDateOfBirth;
}
public function setMotherSDateOfBirth(?\DateTimeInterface $motherSDateOfBirth): self
{
$this->motherSDateOfBirth = $motherSDateOfBirth;
return $this;
}
public function getMotherSPlaceOfBirth(): ?string
{
return $this->motherSPlaceOfBirth;
}
public function setMotherSPlaceOfBirth(?string $motherSPlaceOfBirth): self
{
$this->motherSPlaceOfBirth = $motherSPlaceOfBirth;
return $this;
}
public function getMotherSProfession(): ?string
{
return $this->motherSProfession;
}
public function setMotherSProfession(?string $motherSProfession): self
{
$this->motherSProfession = $motherSProfession;
return $this;
}
public function getHospital(): ?Hospital
{
return $this->hospital;
}
public function setHospital(?Hospital $hospital): self
{
$this->hospital = $hospital;
return $this;
}
public function getFatherSEmail(): ?string
{
return $this->fatherSEmail;
}
public function setFatherSEmail(?string $fatherSEmail): self
{
$this->fatherSEmail = $fatherSEmail;
return $this;
}
public function getMotherSEmail(): ?string
{
return $this->motherSEmail;
}
public function setMotherSEmail(?string $motherSEmail): self
{
$this->motherSEmail = $motherSEmail;
return $this;
}
public function getFirstWitness(): ?string
{
return $this->firstWitness;
}
public function setFirstWitness(?string $firstWitness): self
{
$this->firstWitness = $firstWitness;
return $this;
}
public function getSecondWitness(): ?string
{
return $this->secondWitness;
}
public function setSecondWitness(?string $secondWitness): self
{
$this->secondWitness = $secondWitness;
return $this;
}
public function getOtherContact(): ?string
{
return $this->otherContact;
}
public function setOtherContact(?string $otherContact): self
{
$this->otherContact = $otherContact;
return $this;
}
public function __toString() {
return $this->getNameOfTheChild();
}
public function __construct() {
$this->setUpdateAt(new \DateTime());
}
/**
* @ORM\PreUpdate
*/
public function __updateDate() {
$this->setUpdateAt(new \DateTime());
}
public function getUpdateAt(): ?\DateTimeInterface
{
return $this->updateAt;
}
public function setUpdateAt(?\DateTimeInterface $updateAt): self
{
$this->updateAt = $updateAt;
return $this;
}
public function getFatherContact(): ?string
{
return $this->fatherContact;
}
public function setFatherContact(?string $fatherContact): self
{
$this->fatherContact = $fatherContact;
return $this;
}
public function getMotherContact(): ?string
{
return $this->motherContact;
}
public function setMotherContact(?string $motherContact): self
{
$this->motherContact = $motherContact;
return $this;
}
public function getFirstWitnessNic(): ?string
{
return $this->firstWitnessNic;
}
public function setFirstWitnessNic(?string $firstWitnessNic): self
{
$this->firstWitnessNic = $firstWitnessNic;
return $this;
}
public function getSecondWitnessNic(): ?string
{
return $this->secondWitnessNic;
}
public function setSecondWitnessNic(?string $secondWitnessNic): self
{
$this->secondWitnessNic = $secondWitnessNic;
return $this;
}
public function getFirstWitnessPhoneNumber(): ?string
{
return $this->firstWitnessPhoneNumber;
}
public function setFirstWitnessPhoneNumber(?string $firstWitnessPhoneNumber): self
{
$this->firstWitnessPhoneNumber = $firstWitnessPhoneNumber;
return $this;
}
public function getSecondWitnessPhoneNumber(): ?string
{
return $this->secondWitnessPhoneNumber;
}
public function setSecondWitnessPhoneNumber(?string $secondWitnessPhoneNumber): self
{
$this->secondWitnessPhoneNumber = $secondWitnessPhoneNumber;
return $this;
}
public function getFatherNic(): ?string
{
return $this->fatherNic;
}
public function setFatherNic(?string $fatherNic): self
{
$this->fatherNic = $fatherNic;
return $this;
}
public function getMotherNic(): ?string
{
return $this->motherNic;
}
public function setMotherNic(?string $motherNic): self
{
$this->motherNic = $motherNic;
return $this;
}
public function getBirthDeclarationFile(): ?string
{
return $this->birthDeclarationFile;
}
public function setBirthDeclarationFile(?string $birthDeclarationFile): self
{
$this->birthDeclarationFile = $birthDeclarationFile;
return $this;
}
public function getMarriageCertificate(): ?string
{
return $this->marriageCertificate;
}
public function setMarriageCertificate(?string $marriageCertificate): self
{
$this->marriageCertificate = $marriageCertificate;
return $this;
}
public function getChildTab(){
$date = new \DateTime();
$table = ['Name'=> $this->getNameOfTheChild(),
'On'=> $this->getDateOfBirth(),
'Was Born at'=>$this->getHospital(),
'Sex'=> $this->getSex(),
'Of'=> $this->getNameOfTheFather(),
'Born on the'=>$this->getFathersDateOfBirth(),
'at'=>$this->getFathersPlaceOfBirth(),
'Father\'s Residence'=>$this->getFatherSResidence(),
'Father\'s Profession'=>$this->getFatherSProfession(),
'And of'=> $this->getNameOfTheMother(),
'Born on'=>$this->getMothersDateOfBirth(),
'at'=>$this->getMothersPlaceOfBirth(),
'Mother\'s Residence'=>$this->getMotherSResidence(),
'Mother\'s Profession'=>$this->getMotherSProfession(),
'Drawn up on the'=>$date->format('d-m-y'),
];
foreach ($table as $key=>$val){
if (is_a($val, 'Datetime')){
$table[$key]=$val->format('d M Y');
}
}
$tab = $table;
return $tab;
}
public function strtofile($param,$name) {
return $file = new \Symfony\Component\HttpFoundation\File\File(_DIR_.'/../../public/uploads/'.$name.'/'.$param);
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): self
{
$this->user = $user;
return $this;
}
public function getOfficerValidation1(): ?bool
{
return $this->officerValidation1;
}
public function setOfficerValidation1(?bool $officerValidation1): self
{
$this->officerValidation1 = $officerValidation1;
return $this;
}
public function getOfficerValidation2(): ?bool
{
return $this->officerValidation2;
}
public function setOfficerValidation2(?bool $officerValidation2): self
{
$this->officerValidation2 = $officerValidation2;
return $this;
}
public function getSecretaryValidation(): ?bool
{
return $this->secretaryValidation;
}
public function setSecretaryValidation(?bool $secretaryValidation): self
{
$this->secretaryValidation = $secretaryValidation;
return $this;
}
}