src/Entity/Child.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ChildRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Component\Validator\Constraints as Assert;
  6. /**
  7. * @ORM\Entity(repositoryClass=ChildRepository::class)
  8. * @ORM\HasLifecycleCallbacks()
  9. */
  10. class Child
  11. {
  12. /**
  13. * @ORM\Id
  14. * @ORM\GeneratedValue
  15. * @ORM\Column(type="integer")
  16. */
  17. private $id;
  18. /**
  19. * @ORM\Column(type="string", length=255, nullable=true)
  20. */
  21. private $nameOfTheChild;
  22. /**
  23. * @ORM\Column(type="datetime")
  24. */
  25. private $dateOfBirth;
  26. /**
  27. * @ORM\Column(type="string", length=255, nullable=true)
  28. */
  29. private $placeOfBirth;
  30. /**
  31. * @ORM\Column(type="string", length=255)
  32. */
  33. private $sex;
  34. /**
  35. * @ORM\Column(type="string", length=255, nullable=true)
  36. */
  37. private $nameOfTheFather;
  38. /**
  39. * @ORM\Column(type="string", length=255,nullable=true)
  40. */
  41. private $fatherSProfession;
  42. /**
  43. * @ORM\Column(type="string", length=255, nullable=true)
  44. */
  45. private $fatherSResidence;
  46. /**
  47. * @ORM\Column(type="date",nullable=true)
  48. */
  49. private $fathersDateOfBirth;
  50. /**
  51. * @ORM\Column(type="string", length=255,nullable=true)
  52. */
  53. private $fathersPlaceOfBirth;
  54. /**
  55. * @ORM\Column(type="string", length=255)
  56. */
  57. private $nameOfTheMother;
  58. /**
  59. * @ORM\Column(type="string", length=255,nullable=true)
  60. */
  61. private $motherSResidence;
  62. /**
  63. * @ORM\Column(type="date",nullable=true)
  64. */
  65. private $motherSDateOfBirth;
  66. /**
  67. * @ORM\Column(type="string", length=255,nullable=true)
  68. */
  69. private $motherSPlaceOfBirth;
  70. /**
  71. * @ORM\Column(type="string", length=255,nullable=true)
  72. */
  73. private $motherSProfession;
  74. /**
  75. * @ORM\ManyToOne(targetEntity=Hospital::class, inversedBy="Children")
  76. */
  77. private $hospital;
  78. /**
  79. * @ORM\Column(type="string", length=255, nullable=true)
  80. */
  81. private $fatherSEmail;
  82. /**
  83. * @ORM\Column(type="string", length=255, nullable=true)
  84. */
  85. private $motherSEmail;
  86. /**
  87. * @ORM\Column(type="string", length=255, nullable=true)
  88. */
  89. private $firstWitness;
  90. /**
  91. * @ORM\Column(type="string", length=255, nullable=true)
  92. */
  93. private $secondWitness;
  94. /**
  95. * @ORM\Column(type="string", length=255, nullable=true)
  96. */
  97. private $otherContact;
  98. /**
  99. * @ORM\Column(type="datetime", nullable=true)
  100. */
  101. private $updateAt;
  102. /**
  103. * @ORM\Column(type="string", length=255, nullable=true)
  104. */
  105. private $fatherContact;
  106. /**
  107. * @ORM\Column(type="string", length=255,nullable=true)
  108. */
  109. private $motherContact;
  110. /**
  111. * @ORM\Column(type="string", length=255, nullable=true)
  112. */
  113. private $firstWitnessNic;
  114. /**
  115. * @ORM\Column(type="string", length=255, nullable=true)
  116. */
  117. private $secondWitnessNic;
  118. /**
  119. * @ORM\Column(type="string", length=255, nullable=true)
  120. */
  121. private $firstWitnessPhoneNumber;
  122. /**
  123. * @ORM\Column(type="string", length=255, nullable=true)
  124. *
  125. */
  126. private $secondWitnessPhoneNumber;
  127. /**
  128. * @ORM\Column(type="string", length=255, nullable=true)
  129. */
  130. private $fatherNic;
  131. /**
  132. * @ORM\Column(type="string", length=255, nullable=true)
  133. */
  134. private $motherNic;
  135. /**
  136. * @ORM\Column(type="string", length=255, nullable=true)
  137. */
  138. private $birthDeclarationFile;
  139. /**
  140. * @ORM\Column(type="string", length=255, nullable=true)
  141. */
  142. private $marriageCertificate;
  143. /**
  144. * @ORM\ManyToOne(targetEntity=User::class, inversedBy="children")
  145. */
  146. private $user;
  147. /**
  148. * @ORM\Column(type="boolean", nullable=true)
  149. */
  150. private $officerValidation1;
  151. /**
  152. * @ORM\Column(type="boolean", nullable=true)
  153. */
  154. private $officerValidation2;
  155. /**
  156. * @ORM\Column(type="boolean", nullable=true)
  157. */
  158. private $secretaryValidation;
  159. public function getId(): ?int
  160. {
  161. return $this->id;
  162. }
  163. public function getNameOfTheChild(): ?string
  164. {
  165. return $this->nameOfTheChild;
  166. }
  167. public function setNameOfTheChild(?string $nameOfTheChild): self
  168. {
  169. $this->nameOfTheChild = $nameOfTheChild;
  170. return $this;
  171. }
  172. public function getDateOfBirth(): ?\DateTimeInterface
  173. {
  174. return $this->dateOfBirth;
  175. }
  176. public function setDateOfBirth(\DateTimeInterface $dateOfBirth): self
  177. {
  178. $this->dateOfBirth = $dateOfBirth;
  179. return $this;
  180. }
  181. public function getPlaceOfBirth(): ?string
  182. {
  183. return $this->placeOfBirth;
  184. }
  185. public function setPlaceOfBirth(?string $placeOfBirth): self
  186. {
  187. $this->placeOfBirth = $placeOfBirth;
  188. return $this;
  189. }
  190. public function getSex(): ?string
  191. {
  192. return $this->sex;
  193. }
  194. public function setSex(string $sex): self
  195. {
  196. $this->sex = $sex;
  197. return $this;
  198. }
  199. public function getNameOfTheFather(): ?string
  200. {
  201. return $this->nameOfTheFather;
  202. }
  203. public function setNameOfTheFather(?string $nameOfTheFather): self
  204. {
  205. $this->nameOfTheFather = $nameOfTheFather;
  206. return $this;
  207. }
  208. public function getFatherSProfession(): ?string
  209. {
  210. return $this->fatherSProfession;
  211. }
  212. public function setFatherSProfession(?string $fatherSProfession): self
  213. {
  214. $this->fatherSProfession = $fatherSProfession;
  215. return $this;
  216. }
  217. public function getFatherSResidence(): ?string
  218. {
  219. return $this->fatherSResidence;
  220. }
  221. public function setFatherSResidence(?string $fatherSResidence): self
  222. {
  223. $this->fatherSResidence = $fatherSResidence;
  224. return $this;
  225. }
  226. public function getFathersDateOfBirth(): ?\DateTimeInterface
  227. {
  228. return $this->fathersDateOfBirth;
  229. }
  230. public function setFathersDateOfBirth(?\DateTimeInterface $fathersDateOfBirth): self
  231. {
  232. $this->fathersDateOfBirth = $fathersDateOfBirth;
  233. return $this;
  234. }
  235. public function getFathersPlaceOfBirth(): ?string
  236. {
  237. return $this->fathersPlaceOfBirth;
  238. }
  239. public function setFathersPlaceOfBirth(?string $fathersPlaceOfBirth): self
  240. {
  241. $this->fathersPlaceOfBirth = $fathersPlaceOfBirth;
  242. return $this;
  243. }
  244. public function getNameOfTheMother(): ?string
  245. {
  246. return $this->nameOfTheMother;
  247. }
  248. public function setNameOfTheMother(string $nameOfTheMother): self
  249. {
  250. $this->nameOfTheMother = $nameOfTheMother;
  251. return $this;
  252. }
  253. public function getMotherSResidence(): ?string
  254. {
  255. return $this->motherSResidence;
  256. }
  257. public function setMotherSResidence(?string $motherSResidence): self
  258. {
  259. $this->motherSResidence = $motherSResidence;
  260. return $this;
  261. }
  262. public function getMotherSDateOfBirth(): ?\DateTimeInterface
  263. {
  264. return $this->motherSDateOfBirth;
  265. }
  266. public function setMotherSDateOfBirth(?\DateTimeInterface $motherSDateOfBirth): self
  267. {
  268. $this->motherSDateOfBirth = $motherSDateOfBirth;
  269. return $this;
  270. }
  271. public function getMotherSPlaceOfBirth(): ?string
  272. {
  273. return $this->motherSPlaceOfBirth;
  274. }
  275. public function setMotherSPlaceOfBirth(?string $motherSPlaceOfBirth): self
  276. {
  277. $this->motherSPlaceOfBirth = $motherSPlaceOfBirth;
  278. return $this;
  279. }
  280. public function getMotherSProfession(): ?string
  281. {
  282. return $this->motherSProfession;
  283. }
  284. public function setMotherSProfession(?string $motherSProfession): self
  285. {
  286. $this->motherSProfession = $motherSProfession;
  287. return $this;
  288. }
  289. public function getHospital(): ?Hospital
  290. {
  291. return $this->hospital;
  292. }
  293. public function setHospital(?Hospital $hospital): self
  294. {
  295. $this->hospital = $hospital;
  296. return $this;
  297. }
  298. public function getFatherSEmail(): ?string
  299. {
  300. return $this->fatherSEmail;
  301. }
  302. public function setFatherSEmail(?string $fatherSEmail): self
  303. {
  304. $this->fatherSEmail = $fatherSEmail;
  305. return $this;
  306. }
  307. public function getMotherSEmail(): ?string
  308. {
  309. return $this->motherSEmail;
  310. }
  311. public function setMotherSEmail(?string $motherSEmail): self
  312. {
  313. $this->motherSEmail = $motherSEmail;
  314. return $this;
  315. }
  316. public function getFirstWitness(): ?string
  317. {
  318. return $this->firstWitness;
  319. }
  320. public function setFirstWitness(?string $firstWitness): self
  321. {
  322. $this->firstWitness = $firstWitness;
  323. return $this;
  324. }
  325. public function getSecondWitness(): ?string
  326. {
  327. return $this->secondWitness;
  328. }
  329. public function setSecondWitness(?string $secondWitness): self
  330. {
  331. $this->secondWitness = $secondWitness;
  332. return $this;
  333. }
  334. public function getOtherContact(): ?string
  335. {
  336. return $this->otherContact;
  337. }
  338. public function setOtherContact(?string $otherContact): self
  339. {
  340. $this->otherContact = $otherContact;
  341. return $this;
  342. }
  343. public function __toString() {
  344. return $this->getNameOfTheChild();
  345. }
  346. public function __construct() {
  347. $this->setUpdateAt(new \DateTime());
  348. }
  349. /**
  350. * @ORM\PreUpdate
  351. */
  352. public function __updateDate() {
  353. $this->setUpdateAt(new \DateTime());
  354. }
  355. public function getUpdateAt(): ?\DateTimeInterface
  356. {
  357. return $this->updateAt;
  358. }
  359. public function setUpdateAt(?\DateTimeInterface $updateAt): self
  360. {
  361. $this->updateAt = $updateAt;
  362. return $this;
  363. }
  364. public function getFatherContact(): ?string
  365. {
  366. return $this->fatherContact;
  367. }
  368. public function setFatherContact(?string $fatherContact): self
  369. {
  370. $this->fatherContact = $fatherContact;
  371. return $this;
  372. }
  373. public function getMotherContact(): ?string
  374. {
  375. return $this->motherContact;
  376. }
  377. public function setMotherContact(?string $motherContact): self
  378. {
  379. $this->motherContact = $motherContact;
  380. return $this;
  381. }
  382. public function getFirstWitnessNic(): ?string
  383. {
  384. return $this->firstWitnessNic;
  385. }
  386. public function setFirstWitnessNic(?string $firstWitnessNic): self
  387. {
  388. $this->firstWitnessNic = $firstWitnessNic;
  389. return $this;
  390. }
  391. public function getSecondWitnessNic(): ?string
  392. {
  393. return $this->secondWitnessNic;
  394. }
  395. public function setSecondWitnessNic(?string $secondWitnessNic): self
  396. {
  397. $this->secondWitnessNic = $secondWitnessNic;
  398. return $this;
  399. }
  400. public function getFirstWitnessPhoneNumber(): ?string
  401. {
  402. return $this->firstWitnessPhoneNumber;
  403. }
  404. public function setFirstWitnessPhoneNumber(?string $firstWitnessPhoneNumber): self
  405. {
  406. $this->firstWitnessPhoneNumber = $firstWitnessPhoneNumber;
  407. return $this;
  408. }
  409. public function getSecondWitnessPhoneNumber(): ?string
  410. {
  411. return $this->secondWitnessPhoneNumber;
  412. }
  413. public function setSecondWitnessPhoneNumber(?string $secondWitnessPhoneNumber): self
  414. {
  415. $this->secondWitnessPhoneNumber = $secondWitnessPhoneNumber;
  416. return $this;
  417. }
  418. public function getFatherNic(): ?string
  419. {
  420. return $this->fatherNic;
  421. }
  422. public function setFatherNic(?string $fatherNic): self
  423. {
  424. $this->fatherNic = $fatherNic;
  425. return $this;
  426. }
  427. public function getMotherNic(): ?string
  428. {
  429. return $this->motherNic;
  430. }
  431. public function setMotherNic(?string $motherNic): self
  432. {
  433. $this->motherNic = $motherNic;
  434. return $this;
  435. }
  436. public function getBirthDeclarationFile(): ?string
  437. {
  438. return $this->birthDeclarationFile;
  439. }
  440. public function setBirthDeclarationFile(?string $birthDeclarationFile): self
  441. {
  442. $this->birthDeclarationFile = $birthDeclarationFile;
  443. return $this;
  444. }
  445. public function getMarriageCertificate(): ?string
  446. {
  447. return $this->marriageCertificate;
  448. }
  449. public function setMarriageCertificate(?string $marriageCertificate): self
  450. {
  451. $this->marriageCertificate = $marriageCertificate;
  452. return $this;
  453. }
  454. public function getChildTab(){
  455. $date = new \DateTime();
  456. $table = ['Name'=> $this->getNameOfTheChild(),
  457. 'On'=> $this->getDateOfBirth(),
  458. 'Was Born at'=>$this->getHospital(),
  459. 'Sex'=> $this->getSex(),
  460. 'Of'=> $this->getNameOfTheFather(),
  461. 'Born on the'=>$this->getFathersDateOfBirth(),
  462. 'at'=>$this->getFathersPlaceOfBirth(),
  463. 'Father\'s Residence'=>$this->getFatherSResidence(),
  464. 'Father\'s Profession'=>$this->getFatherSProfession(),
  465. 'And of'=> $this->getNameOfTheMother(),
  466. 'Born on'=>$this->getMothersDateOfBirth(),
  467. 'at'=>$this->getMothersPlaceOfBirth(),
  468. 'Mother\'s Residence'=>$this->getMotherSResidence(),
  469. 'Mother\'s Profession'=>$this->getMotherSProfession(),
  470. 'Drawn up on the'=>$date->format('d-m-y'),
  471. ];
  472. foreach ($table as $key=>$val){
  473. if (is_a($val, 'Datetime')){
  474. $table[$key]=$val->format('d M Y');
  475. }
  476. }
  477. $tab = $table;
  478. return $tab;
  479. }
  480. public function strtofile($param,$name) {
  481. return $file = new \Symfony\Component\HttpFoundation\File\File(_DIR_.'/../../public/uploads/'.$name.'/'.$param);
  482. }
  483. public function getUser(): ?User
  484. {
  485. return $this->user;
  486. }
  487. public function setUser(?User $user): self
  488. {
  489. $this->user = $user;
  490. return $this;
  491. }
  492. public function getOfficerValidation1(): ?bool
  493. {
  494. return $this->officerValidation1;
  495. }
  496. public function setOfficerValidation1(?bool $officerValidation1): self
  497. {
  498. $this->officerValidation1 = $officerValidation1;
  499. return $this;
  500. }
  501. public function getOfficerValidation2(): ?bool
  502. {
  503. return $this->officerValidation2;
  504. }
  505. public function setOfficerValidation2(?bool $officerValidation2): self
  506. {
  507. $this->officerValidation2 = $officerValidation2;
  508. return $this;
  509. }
  510. public function getSecretaryValidation(): ?bool
  511. {
  512. return $this->secretaryValidation;
  513. }
  514. public function setSecretaryValidation(?bool $secretaryValidation): self
  515. {
  516. $this->secretaryValidation = $secretaryValidation;
  517. return $this;
  518. }
  519. }