src/Entity/Guardian.php line 24

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\GuardianRegister\GuardianRegister;
  4. use App\Entity\Guardian\GuardianPriceDiscount;
  5. use App\Entity\Guardian\GuardianSMSResponse;
  6. use App\Repository\GuardianRepository;
  7. use Doctrine\Common\Collections\ArrayCollection;
  8. use Doctrine\Common\Collections\Collection;
  9. use Doctrine\ORM\Mapping as ORM;
  10. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  11. use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
  12. use Symfony\Component\Security\Core\User\UserInterface;
  13. use Symfony\Component\Serializer\Annotation\Groups;
  14. /**
  15. * @ORM\Entity(repositoryClass=GuardianRepository::class)
  16. * @ORM\Table(name="guardian", indexes={
  17. * @ORM\Index(name="g_email_phonenumber_status_idx", columns={"email", "phone_number", "status"}),
  18. * })
  19. * @UniqueEntity("email")
  20. */
  21. class Guardian implements UserInterface, PasswordAuthenticatedUserInterface
  22. {
  23. const STATUS_PREPARING = [
  24. 'value' => "PREPARING",
  25. 'text' => 'Ruošiama',
  26. 'color' => '#f8d7da'
  27. ];
  28. const STATUS_SENT = [
  29. 'value' => "SENT",
  30. 'text' => 'Išsiųsta',
  31. 'color' => '#fff3cd'
  32. ];
  33. const STATUS_CONFIRMED = [
  34. 'value' => "CONFIRMED",
  35. 'text' => 'Patvirtinta',
  36. 'color' => '#d4edda'
  37. ];
  38. const STATUS_CANCELLED = [
  39. 'value' => "CANCELLED",
  40. 'text' => 'Neaktyvus',
  41. 'color' => '#FF0000'
  42. ];
  43. const STATUS_LEFT = [
  44. 'value' => "LEFT",
  45. 'text' => 'Išėjęs',
  46. 'color' => '#ffa600'
  47. ];
  48. const STATUS_OVERPAID = [
  49. 'value' => "OVERPAID",
  50. 'text' => 'Permoka',
  51. 'color' => '#45C6F6'
  52. ];
  53. const GUARDIAN_STATUSES = [self::STATUS_PREPARING, self::STATUS_SENT, self::STATUS_CONFIRMED, self::STATUS_CANCELLED, self::STATUS_LEFT, self::STATUS_OVERPAID];
  54. /**
  55. * @ORM\Id
  56. * @ORM\GeneratedValue
  57. * @ORM\Column(type="integer")
  58. * @Groups({"CensorshipList","ResponsesList", "TeacherResponsesList", "GuardianRegisterList", "ChildPreferenceAssignmentList","LessonList", "NotificationList", "ChildPreferenceList", "AdminConfirmationsList"})
  59. */
  60. private $id;
  61. /**
  62. * @ORM\Column(type="string", length=255, nullable=true)
  63. * @Groups({"showme"})
  64. * @Groups({"GuardianList","ChildList","ResponsesList", "ChildPreferenceAssignmentList","LessonList", "NotificationList", "ChildPreferenceList"})
  65. */
  66. private $fullname;
  67. /**
  68. * @ORM\Column(type="string", length=180, nullable=true)
  69. * @Groups({"CensorshipList","showme","GuardianList","ChildList","ResponsesList", "ChildPreferenceAssignmentList","LessonList", "DeclineHistoryList", "NotificationList", "ChildPreferenceList", "AdminConfirmationsList"})
  70. */
  71. private $email;
  72. /**
  73. * @ORM\Column(type="json")
  74. */
  75. private $roles = [];
  76. /**
  77. * @var string The hashed password
  78. * @ORM\Column(type="string")
  79. */
  80. private $password;
  81. /**
  82. * @ORM\OneToMany(targetEntity=Child::class, mappedBy="guardian", cascade={"all"})
  83. * @Groups({"GuardianList"})
  84. */
  85. private $children;
  86. /**
  87. * @ORM\Column(type="string", length=255, nullable=true)
  88. * @Groups({"showme"})
  89. * @Groups({"GuardianList", "TeacherResponsesList","LessonList", "ChildPreferenceList"})
  90. */
  91. private $phoneNumber;
  92. /**
  93. * @ORM\Column(type="text", nullable=true)
  94. * @Groups({"GuardianList"})
  95. */
  96. private $comment;
  97. /**
  98. * @ORM\Column(type="string", length=255, nullable=true)
  99. */
  100. private $details;
  101. /**
  102. * @ORM\Column(type="string", length=255, nullable=true)
  103. * @Groups({"GuardianList"})
  104. */
  105. private $balanceStatus = Payment::STATUS_NOTPAID;
  106. /**
  107. * @ORM\Column(type="string", length=255, nullable=true)
  108. * @Groups({"NotificationList"})
  109. */
  110. private $profileImagePath;
  111. /**
  112. * @ORM\OneToMany(targetEntity=Payment::class, mappedBy="guardian", cascade={"all"})
  113. */
  114. private $payments;
  115. /**
  116. * @ORM\OneToMany(targetEntity=PaymentLog::class, mappedBy="guardian", cascade={"all"})
  117. */
  118. private $paymentLogs;
  119. /**
  120. * @ORM\Column(type="datetime", nullable=true)
  121. * @Groups({"showme","GuardianList"})
  122. */
  123. private $dateAdd;
  124. /**
  125. * @ORM\Column(type="string", length=255, nullable=true)
  126. */
  127. private $status = self::STATUS_PREPARING['value'];
  128. /**
  129. * @ORM\Column(type="string", length=255, nullable=true)
  130. */
  131. private $source;
  132. /**
  133. * @ORM\Column(type="string", length=255, nullable=true)
  134. */
  135. private $company;
  136. /**
  137. * @ORM\Column(type="string", length=255, nullable=true)
  138. */
  139. private $companyCode;
  140. /**
  141. * @ORM\Column(type="string", length=255, nullable=true)
  142. */
  143. private $vatNumber;
  144. /**
  145. * @ORM\Column(type="string", length=255, nullable=true)
  146. */
  147. private $invoicePurpose;
  148. /**
  149. * @ORM\Column(type="boolean", options={"default" : "1"})
  150. */
  151. private $emailReminders = 1;
  152. /**
  153. * @ORM\Column(type="boolean", options={"default" : "1"})
  154. */
  155. private $smsReminders = 1;
  156. /**
  157. * @ORM\Column(type="boolean", options={"default" : "0"})
  158. */
  159. private $isFree = 0;
  160. /**
  161. * @ORM\Column(type="boolean", nullable=true,options={"default" : "0"})
  162. */
  163. private $isDeleted = false;
  164. /**
  165. * @ORM\OneToMany(targetEntity=PriceChange::class, mappedBy="guardian", cascade={"all"})
  166. */
  167. private $priceChanges;
  168. /**
  169. * @ORM\Column(type="boolean", nullable=true,options={"default" : "0"})
  170. */
  171. private $showSurvey = false;
  172. /**
  173. * @ORM\OneToMany(targetEntity=GuardianSurvey::class, mappedBy="guardian")
  174. */
  175. private $guardianSurveys;
  176. /**
  177. * @ORM\Column(type="string", length=255, nullable=true)
  178. * @Groups({"showme","GuardianList"})
  179. */
  180. private $summer;
  181. /**
  182. * @ORM\Column(type="string", length=255, nullable=true)
  183. * @Groups({"GuardianList"})
  184. */
  185. private $summerAdditional;
  186. private $summerDate;
  187. /**
  188. * @ORM\ManyToOne(targetEntity=Admin::class)
  189. */
  190. private $summerByAdmin;
  191. /**
  192. * @ORM\OneToMany(targetEntity=CustomQuestionnaireGuardianAnswer::class, mappedBy="guardian")
  193. */
  194. private $customQuestionnaireGuardianAnswers;
  195. /**
  196. * @ORM\ManyToOne(targetEntity=GuardianContract::class, inversedBy="guardians")
  197. */
  198. private $guardianContract;
  199. /**
  200. * @ORM\OneToMany(targetEntity=PaymentNotificationLog::class, mappedBy="guardian")
  201. */
  202. private $paymentNotificationLogs;
  203. /**
  204. * @ORM\Column(type="boolean", nullable=true)
  205. */
  206. private $blockNextDayLessonsReminders;
  207. /**
  208. * @ORM\Column(type="boolean", nullable=true)
  209. */
  210. private $blockTodayLessonsReminders;
  211. /**
  212. * @ORM\Column(type="string", length=255, nullable=true)
  213. */
  214. private $lastname;
  215. /**
  216. * @ORM\OneToOne(targetEntity=GuardianRegister::class, mappedBy="guardian", cascade={"persist", "remove"})
  217. * @Groups({"ChildPreferenceAssignmentList","GuardianList"})
  218. */
  219. private $guardianRegister;
  220. /**
  221. * @ORM\OneToOne(targetEntity=GuardianSMSResponse::class, mappedBy="guardian", cascade={"persist", "remove"})
  222. */
  223. private $smsResponse;
  224. /**
  225. * @ORM\Column(type="boolean", nullable=true)
  226. */
  227. private $invoiceCompanyInfo = 0;
  228. /**
  229. * @ORM\Column(type="boolean", nullable=true)
  230. */
  231. private $invoiceRealLessonAmount = 0;
  232. /**
  233. * @ORM\Column(type="boolean", nullable=true)
  234. */
  235. private $credentialsSent;
  236. /**
  237. * @ORM\Column(type="datetime", nullable=true)
  238. */
  239. private $childEmailModal;
  240. /**
  241. * @ORM\Column(type="boolean", nullable=true)
  242. * @Groups({"GuardianList"})
  243. */
  244. private $autumn2024back;
  245. /**
  246. * @ORM\Column(type="datetime", nullable=true)
  247. */
  248. private $autumn2024backDate;
  249. /**
  250. * @ORM\ManyToOne(targetEntity=Admin::class)
  251. */
  252. private $autumn2024backByAdmin;
  253. /**
  254. * @ORM\Column(type="boolean", nullable=true)
  255. */
  256. private $notCommingBack2024;
  257. /**
  258. * @ORM\Column(type="datetime", nullable=true)
  259. */
  260. private $notCommingBack2024Date;
  261. /**
  262. * @ORM\ManyToOne(targetEntity=Admin::class)
  263. */
  264. private $notCommingBack2024ByAdmin;
  265. /**
  266. * @ORM\Column(type="boolean", nullable=true)
  267. * @Groups({"GuardianList"})
  268. */
  269. private $progress;
  270. /**
  271. * @ORM\Column(type="datetime", nullable=true)
  272. */
  273. private $progressDate;
  274. /**
  275. * @ORM\ManyToOne(targetEntity=Admin::class)
  276. */
  277. private $progressByAdmin;
  278. /**
  279. * @ORM\Column(type="float", nullable=true)
  280. */
  281. private $hourPrice;
  282. /**
  283. * @ORM\Column(type="datetime", nullable=true)
  284. */
  285. private $contractPricingFrom;
  286. /**
  287. * @ORM\OneToMany(targetEntity=GuardianPriceDiscount::class, mappedBy="guardian")
  288. */
  289. private $guardianPriceDiscounts;
  290. /**
  291. * @ORM\Column(type="boolean", nullable=true)
  292. */
  293. private $priceNeverChanges;
  294. /**
  295. * @ORM\Column(type="text", nullable=true)
  296. */
  297. private $googleRefreshToken;
  298. /**
  299. * @ORM\Column(type="json", nullable=true)
  300. */
  301. private $googleAccessToken = [];
  302. /**
  303. * @ORM\OneToMany(targetEntity=AdminConfirmation::class, mappedBy="guardian")
  304. */
  305. private $adminConfirmations;
  306. /**
  307. * @ORM\OneToMany(targetEntity=GuardianActionLog::class, mappedBy="guardian")
  308. */
  309. private $guardianActionLogs;
  310. /**
  311. * @ORM\Column(type="string", length=255, nullable=true)
  312. */
  313. private $referralCode;
  314. /**
  315. * @ORM\Column(type="integer", nullable=true)
  316. */
  317. private $externalSurvey;
  318. /**
  319. * @ORM\Column(type="string", length=255, nullable=true)
  320. */
  321. private $feedback = 1;
  322. /**
  323. * @ORM\Column(type="datetime", nullable=true)
  324. * @Groups({"GuardianList"})
  325. */
  326. private $summerAt;
  327. /**
  328. * @ORM\Column(type="boolean", nullable=true)
  329. */
  330. private $summerClass;
  331. /**
  332. * @ORM\Column(type="boolean", nullable=true)
  333. * @Groups({"GuardianList"})
  334. */
  335. private $flagEarlyPayment;
  336. /**
  337. * @ORM\Column(type="integer", nullable=true)
  338. */
  339. private $earlyPaymentDay;
  340. /**
  341. * @ORM\Column(type="datetime", nullable=true)
  342. */
  343. private $earlyPaymentFrom;
  344. /**
  345. * @ORM\OneToMany(targetEntity=EarlyPayment::class, mappedBy="guardian")
  346. */
  347. private $earlyPayments;
  348. /**
  349. * @ORM\Column(type="float", nullable=true)
  350. */
  351. private $balance;
  352. /**
  353. * @ORM\Column(type="text", nullable=true)
  354. */
  355. private $chatStreamToken;
  356. /**
  357. * @ORM\Column(type="boolean", nullable=true)
  358. * @Groups({"GuardianList"})
  359. */
  360. private $newPriceEmailSent;
  361. /**
  362. * @ORM\Column(type="datetime", nullable=true)
  363. * @Groups({"GuardianList"})
  364. */
  365. private $newEmailOpened;
  366. /**
  367. * @ORM\Column(type="boolean", nullable=true)
  368. * @Groups({"GuardianList"})
  369. */
  370. private $newEmailSubmitted;
  371. /**
  372. * @ORM\Column(type="datetime", nullable=true)
  373. */
  374. private $mobileAppLastUsedAt;
  375. /**
  376. * @ORM\OneToMany(targetEntity=ChatCensorshipJournal::class, mappedBy="guardian")
  377. */
  378. private $chatCensorshipJournals;
  379. /**
  380. * @ORM\Column(type="string", length=255, nullable=true)
  381. */
  382. private $marksignName;
  383. /**
  384. * @ORM\Column(type="string", length=255, nullable=true)
  385. */
  386. private $marksignSurname;
  387. public function __construct()
  388. {
  389. $this->children = new ArrayCollection();
  390. $this->payments = new ArrayCollection();
  391. $this->paymentLogs = new ArrayCollection();
  392. $this->dateAdd = new \DateTime();
  393. $this->priceChanges = new ArrayCollection();
  394. $this->guardianSurveys = new ArrayCollection();
  395. $this->customQuestionnaireGuardianAnswers = new ArrayCollection();
  396. $this->paymentNotificationLogs = new ArrayCollection();
  397. $this->guardianPriceDiscounts = new ArrayCollection();
  398. $this->adminConfirmations = new ArrayCollection();
  399. $this->guardianActionLogs = new ArrayCollection();
  400. $this->earlyPayments = new ArrayCollection();
  401. $this->chatCensorshipJournals = new ArrayCollection();
  402. }
  403. public function getId(): ?int
  404. {
  405. return $this->id;
  406. }
  407. public function getEmail(): ?string
  408. {
  409. return $this->email;
  410. }
  411. public function setEmail(string $email): self
  412. {
  413. $this->email = $email;
  414. return $this;
  415. }
  416. /**
  417. * A visual identifier that represents this user.
  418. *
  419. * @see UserInterface
  420. */
  421. public function getUsername(): string
  422. {
  423. return (string)$this->email;
  424. }
  425. public function getUserIdentifier(): string
  426. {
  427. return (string) $this->email;
  428. }
  429. /**
  430. * @see UserInterface
  431. */
  432. public function getRoles(): array
  433. {
  434. $roles = ['ROLE_GUARDIAN', 'ROLE_USER'];
  435. return array_unique($roles);
  436. }
  437. public function setRoles(array $roles): self
  438. {
  439. $roles = ['ROLE_GUARDIAN', 'ROLE_USER'];
  440. $this->roles = $roles;
  441. return $this;
  442. }
  443. /**
  444. * @see UserInterface
  445. */
  446. public function getPassword(): string
  447. {
  448. return (string)$this->password;
  449. }
  450. public function setPassword(string $password): self
  451. {
  452. $this->password = $password;
  453. return $this;
  454. }
  455. /**
  456. * @see UserInterface
  457. */
  458. public function getSalt()
  459. {
  460. // not needed when using the "bcrypt" algorithm in security.yaml
  461. }
  462. /**
  463. * @see UserInterface
  464. */
  465. public function eraseCredentials()
  466. {
  467. // If you store any temporary, sensitive data on the user, clear it here
  468. // $this->plainPassword = null;
  469. }
  470. /**
  471. * @return Collection|Child[]
  472. */
  473. public function getChildren(): Collection
  474. {
  475. return $this->children;
  476. }
  477. public function addChild(Child $child): self
  478. {
  479. if (!$this->children->contains($child)) {
  480. $this->children[] = $child;
  481. $child->setGuardian($this);
  482. }
  483. return $this;
  484. }
  485. public function removeChild(Child $child): self
  486. {
  487. if ($this->children->removeElement($child)) {
  488. // set the owning side to null (unless already changed)
  489. if ($child->getGuardian() === $this) {
  490. $child->setGuardian(null);
  491. }
  492. }
  493. return $this;
  494. }
  495. public function getFullname(): ?string
  496. {
  497. return $this->fullname;
  498. }
  499. public function setFullname(?string $fullname): self
  500. {
  501. $this->fullname = $fullname;
  502. return $this;
  503. }
  504. public function getPhoneNumber(): ?string
  505. {
  506. return $this->phoneNumber;
  507. }
  508. public function setPhoneNumber(?string $phoneNumber): self
  509. {
  510. $this->phoneNumber = $phoneNumber;
  511. return $this;
  512. }
  513. public function getInvoicePurpose(): ?string
  514. {
  515. return $this->invoicePurpose;
  516. }
  517. public function setInvoicePurpose(?string $invoicePurpose): self
  518. {
  519. $this->invoicePurpose = $invoicePurpose;
  520. return $this;
  521. }
  522. public function getComment(): ?string
  523. {
  524. return $this->comment;
  525. }
  526. public function setComment(?string $comment): self
  527. {
  528. $this->comment = $comment;
  529. return $this;
  530. }
  531. public function getDetails(): ?string
  532. {
  533. return $this->details;
  534. }
  535. public function setDetails(?string $details): self
  536. {
  537. $this->details = $details;
  538. return $this;
  539. }
  540. public function getBalanceStatus(): ?string
  541. {
  542. return $this->balanceStatus;
  543. }
  544. public function setBalanceStatus($balanceStatus): self
  545. {
  546. $this->balanceStatus = $balanceStatus;
  547. return $this;
  548. }
  549. public function __toString()
  550. {
  551. return "{$this->fullname} {$this->email}";
  552. }
  553. public function getProfileImagePath(): ?string
  554. {
  555. return $this->profileImagePath;
  556. }
  557. public function setProfileImagePath(?string $profileImagePath): self
  558. {
  559. $this->profileImagePath = $profileImagePath;
  560. return $this;
  561. }
  562. /**
  563. * @return Collection|Payment[]
  564. */
  565. public function getPayments(): Collection
  566. {
  567. return $this->payments;
  568. }
  569. public function addPayment(Payment $payment): self
  570. {
  571. if (!$this->payments->contains($payment)) {
  572. $this->payments[] = $payment;
  573. $payment->setGuardian($this);
  574. }
  575. return $this;
  576. }
  577. public function removePayment(Payment $payment): self
  578. {
  579. if ($this->payments->removeElement($payment)) {
  580. // set the owning side to null (unless already changed)
  581. if ($payment->getGuardian() === $this) {
  582. $payment->setGuardian(null);
  583. }
  584. }
  585. return $this;
  586. }
  587. /**
  588. * @return Collection|PaymentLog[]
  589. */
  590. public function getPaymentLogs(): Collection
  591. {
  592. return $this->paymentLogs;
  593. }
  594. public function addPaymentLog(PaymentLog $paymentLog): self
  595. {
  596. if (!$this->paymentLogs->contains($paymentLog)) {
  597. $this->paymentLogs[] = $paymentLog;
  598. $paymentLog->setGuardian($this);
  599. }
  600. return $this;
  601. }
  602. public function removePaymentLog(PaymentLog $paymentLog): self
  603. {
  604. if ($this->paymentLogs->removeElement($paymentLog)) {
  605. // set the owning side to null (unless already changed)
  606. if ($paymentLog->getGuardian() === $this) {
  607. $paymentLog->setGuardian(null);
  608. }
  609. }
  610. return $this;
  611. }
  612. public function getDateAdd(): ?\DateTimeInterface
  613. {
  614. return $this->dateAdd;
  615. }
  616. public function setDateAdd(\DateTimeInterface $dateAdd): self
  617. {
  618. $this->dateAdd = $dateAdd;
  619. return $this;
  620. }
  621. public function getStatus(): ?string
  622. {
  623. $text = $this->status;
  624. foreach (self::GUARDIAN_STATUSES as $STATUS) {
  625. if ($STATUS['value'] == $this->status) {
  626. $text = $STATUS['text'];
  627. }
  628. }
  629. return $text;
  630. }
  631. public function setStatus(?string $status): self
  632. {
  633. foreach (self::GUARDIAN_STATUSES as $STATUS) {
  634. if ($STATUS['text'] == $status) {
  635. $status = $STATUS['value'];
  636. }
  637. }
  638. $this->status = $status;
  639. return $this;
  640. }
  641. public function getSource(): ?string
  642. {
  643. return $this->source;
  644. }
  645. public function setSource(?string $source): self
  646. {
  647. $this->source = $source;
  648. return $this;
  649. }
  650. public function getCompany(): ?string
  651. {
  652. return $this->company;
  653. }
  654. public function setCompany(?string $company): self
  655. {
  656. $this->company = $company;
  657. return $this;
  658. }
  659. public function getCompanyCode(): ?string
  660. {
  661. return $this->companyCode;
  662. }
  663. public function setCompanyCode(?string $companyCode): self
  664. {
  665. $this->companyCode = $companyCode;
  666. return $this;
  667. }
  668. public function getVatNumber(): ?string
  669. {
  670. return $this->vatNumber;
  671. }
  672. public function setVatNumber(?string $vatNumber): self
  673. {
  674. $this->vatNumber = $vatNumber;
  675. return $this;
  676. }
  677. public function getEmailReminders(): ?bool
  678. {
  679. return $this->emailReminders;
  680. }
  681. public function setEmailReminders(bool $emailReminders): self
  682. {
  683. $this->emailReminders = $emailReminders;
  684. return $this;
  685. }
  686. public function getSmsReminders(): ?bool
  687. {
  688. return $this->smsReminders;
  689. }
  690. public function setSmsReminders(bool $smsReminders): self
  691. {
  692. $this->smsReminders = $smsReminders;
  693. return $this;
  694. }
  695. public function getIsFree(): ?bool
  696. {
  697. return $this->isFree;
  698. }
  699. public function setIsFree(?bool $isFree): self
  700. {
  701. $this->isFree = $isFree;
  702. return $this;
  703. }
  704. public function getIsDeleted(): ?bool
  705. {
  706. return $this->isDeleted;
  707. }
  708. public function setIsDeleted(?bool $isDeleted): self
  709. {
  710. $this->isDeleted = $isDeleted;
  711. return $this;
  712. }
  713. /**
  714. * @return Collection|PriceChange[]
  715. */
  716. public function getPriceChanges(): Collection
  717. {
  718. return $this->priceChanges;
  719. }
  720. public function addPriceChange(PriceChange $priceChange): self
  721. {
  722. if (!$this->priceChanges->contains($priceChange)) {
  723. $this->priceChanges[] = $priceChange;
  724. $priceChange->setGuardian($this);
  725. }
  726. return $this;
  727. }
  728. public function removePriceChange(PriceChange $priceChange): self
  729. {
  730. if ($this->priceChanges->removeElement($priceChange)) {
  731. // set the owning side to null (unless already changed)
  732. if ($priceChange->getGuardian() === $this) {
  733. $priceChange->setGuardian(null);
  734. }
  735. }
  736. return $this;
  737. }
  738. public function getShowSurvey(): ?bool
  739. {
  740. return $this->showSurvey;
  741. }
  742. public function setShowSurvey(?bool $showSurvey): self
  743. {
  744. $this->showSurvey = $showSurvey;
  745. return $this;
  746. }
  747. /**
  748. * @return Collection|GuardianSurvey[]
  749. */
  750. public function getGuardianSurveys(): Collection
  751. {
  752. return $this->guardianSurveys;
  753. }
  754. public function addGuardianSurvey(GuardianSurvey $guardianSurvey): self
  755. {
  756. if (!$this->guardianSurveys->contains($guardianSurvey)) {
  757. $this->guardianSurveys[] = $guardianSurvey;
  758. $guardianSurvey->setGuardian($this);
  759. }
  760. return $this;
  761. }
  762. public function removeGuardianSurvey(GuardianSurvey $guardianSurvey): self
  763. {
  764. if ($this->guardianSurveys->removeElement($guardianSurvey)) {
  765. // set the owning side to null (unless already changed)
  766. if ($guardianSurvey->getGuardian() === $this) {
  767. $guardianSurvey->setGuardian(null);
  768. }
  769. }
  770. return $this;
  771. }
  772. public function getSummer(): ?string
  773. {
  774. return $this->summer;
  775. }
  776. public function setSummer(?string $summer): self
  777. {
  778. $this->summer = $summer;
  779. return $this;
  780. }
  781. public function getSummerAdditional(): ?string
  782. {
  783. return $this->summerAdditional;
  784. }
  785. public function setSummerAdditional(?string $summerAdditional): self
  786. {
  787. $this->summerAdditional = $summerAdditional;
  788. return $this;
  789. }
  790. /**
  791. * @return Collection|CustomQuestionnaireGuardianAnswer[]
  792. */
  793. public function getCustomQuestionnaireGuardianAnswers(): Collection
  794. {
  795. return $this->customQuestionnaireGuardianAnswers;
  796. }
  797. public function addCustomQuestionnaireGuardianAnswer(CustomQuestionnaireGuardianAnswer $customQuestionnaireGuardianAnswer): self
  798. {
  799. if (!$this->customQuestionnaireGuardianAnswers->contains($customQuestionnaireGuardianAnswer)) {
  800. $this->customQuestionnaireGuardianAnswers[] = $customQuestionnaireGuardianAnswer;
  801. $customQuestionnaireGuardianAnswer->setGuardian($this);
  802. }
  803. return $this;
  804. }
  805. public function removeCustomQuestionnaireGuardianAnswer(CustomQuestionnaireGuardianAnswer $customQuestionnaireGuardianAnswer): self
  806. {
  807. if ($this->customQuestionnaireGuardianAnswers->removeElement($customQuestionnaireGuardianAnswer)) {
  808. // set the owning side to null (unless already changed)
  809. if ($customQuestionnaireGuardianAnswer->getGuardian() === $this) {
  810. $customQuestionnaireGuardianAnswer->setGuardian(null);
  811. }
  812. }
  813. return $this;
  814. }
  815. public function getGuardianContract(): ?GuardianContract
  816. {
  817. return $this->guardianContract;
  818. }
  819. public function setGuardianContract(?GuardianContract $guardianContract): self
  820. {
  821. $this->guardianContract = $guardianContract;
  822. return $this;
  823. }
  824. /**
  825. * @return Collection|PaymentNotificationLog[]
  826. */
  827. public function getPaymentNotificationLogs(): Collection
  828. {
  829. return $this->paymentNotificationLogs;
  830. }
  831. public function addPaymentNotificationLog(PaymentNotificationLog $paymentNotificationLog): self
  832. {
  833. if (!$this->paymentNotificationLogs->contains($paymentNotificationLog)) {
  834. $this->paymentNotificationLogs[] = $paymentNotificationLog;
  835. $paymentNotificationLog->setGuardian($this);
  836. }
  837. return $this;
  838. }
  839. public function removePaymentNotificationLog(PaymentNotificationLog $paymentNotificationLog): self
  840. {
  841. if ($this->paymentNotificationLogs->removeElement($paymentNotificationLog)) {
  842. // set the owning side to null (unless already changed)
  843. if ($paymentNotificationLog->getGuardian() === $this) {
  844. $paymentNotificationLog->setGuardian(null);
  845. }
  846. }
  847. return $this;
  848. }
  849. public function getBlockNextDayLessonsReminders(): ?bool
  850. {
  851. return $this->blockNextDayLessonsReminders;
  852. }
  853. public function setBlockNextDayLessonsReminders(?bool $blockNextDayLessonsReminders): self
  854. {
  855. $this->blockNextDayLessonsReminders = $blockNextDayLessonsReminders;
  856. return $this;
  857. }
  858. public function getBlockTodayLessonsReminders(): ?bool
  859. {
  860. return $this->blockTodayLessonsReminders;
  861. }
  862. public function setBlockTodayLessonsReminders(?bool $blockTodayLessonsReminders): self
  863. {
  864. $this->blockTodayLessonsReminders = $blockTodayLessonsReminders;
  865. return $this;
  866. }
  867. public function getLastname(): ?string
  868. {
  869. return $this->lastname;
  870. }
  871. public function setLastname(?string $lastname): self
  872. {
  873. $this->lastname = $lastname;
  874. return $this;
  875. }
  876. public function getGuardianRegister(): ?GuardianRegister
  877. {
  878. return $this->guardianRegister;
  879. }
  880. public function setGuardianRegister(?GuardianRegister $guardianRegister): self
  881. {
  882. // unset the owning side of the relation if necessary
  883. if ($guardianRegister === null && $this->guardianRegister !== null) {
  884. $this->guardianRegister->setGuardian(null);
  885. }
  886. // set the owning side of the relation if necessary
  887. if ($guardianRegister !== null && $guardianRegister->getGuardian() !== $this) {
  888. $guardianRegister->setGuardian($this);
  889. }
  890. $this->guardianRegister = $guardianRegister;
  891. return $this;
  892. }
  893. public function getUnickoFunction(): ?bool
  894. {
  895. foreach ($this->children as $child) {
  896. /**
  897. * @var ChildPreference $childPreference
  898. */
  899. foreach ($child->getChildPreferences() as $childPreference) {
  900. $teacher = $childPreference->getTeacher();
  901. if (isset($teacher) && $teacher->getUnickoFunction()) {
  902. return true;
  903. }
  904. }
  905. }
  906. return false;
  907. }
  908. public function isInvoiceCompanyInfo(): ?bool
  909. {
  910. return $this->invoiceCompanyInfo;
  911. }
  912. public function setInvoiceCompanyInfo(?bool $invoiceCompanyInfo): self
  913. {
  914. $this->invoiceCompanyInfo = $invoiceCompanyInfo;
  915. return $this;
  916. }
  917. public function isInvoiceRealLessonAmount(): ?bool
  918. {
  919. return $this->invoiceRealLessonAmount;
  920. }
  921. public function setInvoiceRealLessonAmount(?bool $invoiceRealLessonAmount): self
  922. {
  923. $this->invoiceRealLessonAmount = $invoiceRealLessonAmount;
  924. return $this;
  925. }
  926. public function isCredentialsSent(): ?bool
  927. {
  928. return $this->credentialsSent;
  929. }
  930. public function setCredentialsSent(?bool $credentialsSent): self
  931. {
  932. $this->credentialsSent = $credentialsSent;
  933. return $this;
  934. }
  935. public function getChildEmailModal(): ?\DateTimeInterface
  936. {
  937. return $this->childEmailModal;
  938. }
  939. public function setChildEmailModal(?\DateTimeInterface $childEmailModal): self
  940. {
  941. $this->childEmailModal = $childEmailModal;
  942. return $this;
  943. }
  944. public function showChildEmailSurvey()
  945. {
  946. $showModal = false;
  947. $children = $this->getChildren();
  948. if (!$this->getChildEmailModal() || (new \DateTime())->format('Y-m') != $this->getChildEmailModal()->format('Y-m')) {
  949. foreach ($children as $child) {
  950. if (!$child->getEmail()) {
  951. $showModal = true;
  952. }
  953. }
  954. }
  955. return $showModal;
  956. }
  957. public function isAutumn2024back(): ?bool
  958. {
  959. return $this->autumn2024back;
  960. }
  961. public function setAutumn2024back(?bool $autumn2024back): self
  962. {
  963. $this->autumn2024back = $autumn2024back;
  964. return $this;
  965. }
  966. public function getAutumn2024backDate(): ?\DateTimeInterface
  967. {
  968. return $this->autumn2024backDate;
  969. }
  970. public function setAutumn2024backDate(?\DateTimeInterface $autumn2024backDate): self
  971. {
  972. $this->autumn2024backDate = $autumn2024backDate;
  973. return $this;
  974. }
  975. public function getAutumn2024backByAdmin(): ?Admin
  976. {
  977. return $this->autumn2024backByAdmin;
  978. }
  979. public function setAutumn2024backByAdmin(?Admin $autumn2024backByAdmin): self
  980. {
  981. $this->autumn2024backByAdmin = $autumn2024backByAdmin;
  982. return $this;
  983. }
  984. public function getSummerDate(): ?\DateTimeInterface
  985. {
  986. return $this->summerDate;
  987. }
  988. public function setSummerDate(?\DateTimeInterface $summerDate): self
  989. {
  990. $this->summerDate = $summerDate;
  991. return $this;
  992. }
  993. public function getSummerByAdmin(): ?Admin
  994. {
  995. return $this->summerByAdmin;
  996. }
  997. public function setSummerByAdmin(?Admin $summerByAdmin): self
  998. {
  999. $this->summerByAdmin = $summerByAdmin;
  1000. return $this;
  1001. }
  1002. public function isNotCommingBack2024(): ?bool
  1003. {
  1004. return $this->notCommingBack2024;
  1005. }
  1006. public function setNotCommingBack2024(?bool $notCommingBack2024): self
  1007. {
  1008. $this->notCommingBack2024 = $notCommingBack2024;
  1009. return $this;
  1010. }
  1011. public function getNotCommingBack2024Date(): ?\DateTimeInterface
  1012. {
  1013. return $this->notCommingBack2024Date;
  1014. }
  1015. public function setNotCommingBack2024Date(?\DateTimeInterface $notCommingBack2024Date): self
  1016. {
  1017. $this->notCommingBack2024Date = $notCommingBack2024Date;
  1018. return $this;
  1019. }
  1020. public function getNotCommingBack2024ByAdmin(): ?Admin
  1021. {
  1022. return $this->notCommingBack2024ByAdmin;
  1023. }
  1024. public function setNotCommingBack2024ByAdmin(?Admin $notCommingBack2024ByAdmin): self
  1025. {
  1026. $this->notCommingBack2024ByAdmin = $notCommingBack2024ByAdmin;
  1027. return $this;
  1028. }
  1029. public function isProgress(): ?bool
  1030. {
  1031. return $this->progress;
  1032. }
  1033. public function setProgress(?bool $progress): self
  1034. {
  1035. $this->progress = $progress;
  1036. return $this;
  1037. }
  1038. public function getProgressDate(): ?\DateTimeInterface
  1039. {
  1040. return $this->progressDate;
  1041. }
  1042. public function setProgressDate(?\DateTimeInterface $progressDate): self
  1043. {
  1044. $this->progressDate = $progressDate;
  1045. return $this;
  1046. }
  1047. public function getProgressByAdmin(): ?Admin
  1048. {
  1049. return $this->progressByAdmin;
  1050. }
  1051. public function setProgressByAdmin(?Admin $progressByAdmin): self
  1052. {
  1053. $this->progressByAdmin = $progressByAdmin;
  1054. return $this;
  1055. }
  1056. public function getHourPrice(): ?float
  1057. {
  1058. return $this->hourPrice;
  1059. }
  1060. public function setHourPrice(?float $hourPrice): self
  1061. {
  1062. $this->hourPrice = $hourPrice;
  1063. return $this;
  1064. }
  1065. public function getContractPricingFrom(): ?\DateTimeInterface
  1066. {
  1067. return $this->contractPricingFrom;
  1068. }
  1069. public function setContractPricingFrom(?\DateTimeInterface $contractPricingFrom): self
  1070. {
  1071. $this->contractPricingFrom = $contractPricingFrom;
  1072. return $this;
  1073. }
  1074. /**
  1075. * @return Collection<int, GuardianPriceDiscount>
  1076. */
  1077. public function getGuardianPriceDiscounts(): Collection
  1078. {
  1079. return $this->guardianPriceDiscounts;
  1080. }
  1081. public function addGuardianPriceDiscount(GuardianPriceDiscount $guardianPriceDiscount): self
  1082. {
  1083. if (!$this->guardianPriceDiscounts->contains($guardianPriceDiscount)) {
  1084. $this->guardianPriceDiscounts[] = $guardianPriceDiscount;
  1085. $guardianPriceDiscount->setGuardian($this);
  1086. }
  1087. return $this;
  1088. }
  1089. public function removeGuardianPriceDiscount(GuardianPriceDiscount $guardianPriceDiscount): self
  1090. {
  1091. if ($this->guardianPriceDiscounts->removeElement($guardianPriceDiscount)) {
  1092. // set the owning side to null (unless already changed)
  1093. if ($guardianPriceDiscount->getGuardian() === $this) {
  1094. $guardianPriceDiscount->setGuardian(null);
  1095. }
  1096. }
  1097. return $this;
  1098. }
  1099. public function isPriceNeverChanges(): ?bool
  1100. {
  1101. return $this->priceNeverChanges;
  1102. }
  1103. public function setPriceNeverChanges(?bool $priceNeverChanges): self
  1104. {
  1105. $this->priceNeverChanges = $priceNeverChanges;
  1106. return $this;
  1107. }
  1108. public function getGoogleRefreshToken(): ?string
  1109. {
  1110. return $this->googleRefreshToken;
  1111. }
  1112. public function setGoogleRefreshToken(?string $googleRefreshToken): self
  1113. {
  1114. $this->googleRefreshToken = $googleRefreshToken;
  1115. return $this;
  1116. }
  1117. public function getGoogleAccessToken(): ?array
  1118. {
  1119. return $this->googleAccessToken;
  1120. }
  1121. public function setGoogleAccessToken(?array $googleAccessToken): self
  1122. {
  1123. $this->googleAccessToken = $googleAccessToken;
  1124. return $this;
  1125. }
  1126. /**
  1127. * @return Collection<int, AdminConfirmation>
  1128. */
  1129. public function getAdminConfirmations(): Collection
  1130. {
  1131. return $this->adminConfirmations;
  1132. }
  1133. public function addAdminConfirmation(AdminConfirmation $adminConfirmation): self
  1134. {
  1135. if (!$this->adminConfirmations->contains($adminConfirmation)) {
  1136. $this->adminConfirmations[] = $adminConfirmation;
  1137. $adminConfirmation->setGuardian($this);
  1138. }
  1139. return $this;
  1140. }
  1141. public function removeAdminConfirmation(AdminConfirmation $adminConfirmation): self
  1142. {
  1143. if ($this->adminConfirmations->removeElement($adminConfirmation)) {
  1144. // set the owning side to null (unless already changed)
  1145. if ($adminConfirmation->getGuardian() === $this) {
  1146. $adminConfirmation->setGuardian(null);
  1147. }
  1148. }
  1149. return $this;
  1150. }
  1151. /**
  1152. * @return Collection<int, GuardianActionLog>
  1153. */
  1154. public function getGuardianActionLogs(): Collection
  1155. {
  1156. return $this->guardianActionLogs;
  1157. }
  1158. public function addGuardianActionLog(GuardianActionLog $guardianActionLog): self
  1159. {
  1160. if (!$this->guardianActionLogs->contains($guardianActionLog)) {
  1161. $this->guardianActionLogs[] = $guardianActionLog;
  1162. $guardianActionLog->setGuardian($this);
  1163. }
  1164. return $this;
  1165. }
  1166. public function removeGuardianActionLog(GuardianActionLog $guardianActionLog): self
  1167. {
  1168. if ($this->guardianActionLogs->removeElement($guardianActionLog)) {
  1169. // set the owning side to null (unless already changed)
  1170. if ($guardianActionLog->getGuardian() === $this) {
  1171. $guardianActionLog->setGuardian(null);
  1172. }
  1173. }
  1174. return $this;
  1175. }
  1176. public function getReferralCode(): ?string
  1177. {
  1178. return $this->referralCode;
  1179. }
  1180. public function setReferralCode(?string $referralCode): self
  1181. {
  1182. $this->referralCode = $referralCode;
  1183. return $this;
  1184. }
  1185. public function getExternalSurvey(): ?int
  1186. {
  1187. return $this->externalSurvey;
  1188. }
  1189. public function setExternalSurvey(?int $externalSurvey): self
  1190. {
  1191. $this->externalSurvey = $externalSurvey;
  1192. return $this;
  1193. }
  1194. public function getFeedback(): ?string
  1195. {
  1196. return $this->feedback;
  1197. }
  1198. public function setFeedback(?string $feedback): self
  1199. {
  1200. $this->feedback = $feedback;
  1201. return $this;
  1202. }
  1203. public function getSummerAt(): ?\DateTimeInterface
  1204. {
  1205. return $this->summerAt;
  1206. }
  1207. public function setSummerAt(?\DateTimeInterface $summerAt): self
  1208. {
  1209. $this->summerAt = $summerAt;
  1210. return $this;
  1211. }
  1212. public function isSummerClass(): ?bool
  1213. {
  1214. return $this->summerClass;
  1215. }
  1216. public function setSummerClass(?bool $summerClass): self
  1217. {
  1218. $this->summerClass = $summerClass;
  1219. return $this;
  1220. }
  1221. public function isFlagEarlyPayment(): ?bool
  1222. {
  1223. return $this->flagEarlyPayment;
  1224. }
  1225. public function setFlagEarlyPayment(?bool $flagEarlyPayment): self
  1226. {
  1227. $this->flagEarlyPayment = $flagEarlyPayment;
  1228. return $this;
  1229. }
  1230. public function getEarlyPaymentDay(): ?int
  1231. {
  1232. return $this->earlyPaymentDay;
  1233. }
  1234. public function setEarlyPaymentDay(?int $earlyPaymentDay): self
  1235. {
  1236. $this->earlyPaymentDay = $earlyPaymentDay;
  1237. return $this;
  1238. }
  1239. public function getEarlyPaymentFrom(): ?\DateTimeInterface
  1240. {
  1241. return $this->earlyPaymentFrom;
  1242. }
  1243. public function setEarlyPaymentFrom(?\DateTimeInterface $earlyPaymentFrom): self
  1244. {
  1245. $this->earlyPaymentFrom = $earlyPaymentFrom;
  1246. return $this;
  1247. }
  1248. /**
  1249. * @return Collection<int, EarlyPayment>
  1250. */
  1251. public function getEarlyPayments(): Collection
  1252. {
  1253. return $this->earlyPayments;
  1254. }
  1255. public function addEarlyPayment(EarlyPayment $earlyPayment): self
  1256. {
  1257. if (!$this->earlyPayments->contains($earlyPayment)) {
  1258. $this->earlyPayments[] = $earlyPayment;
  1259. $earlyPayment->setGuardian($this);
  1260. }
  1261. return $this;
  1262. }
  1263. public function removeEarlyPayment(EarlyPayment $earlyPayment): self
  1264. {
  1265. if ($this->earlyPayments->removeElement($earlyPayment)) {
  1266. // set the owning side to null (unless already changed)
  1267. if ($earlyPayment->getGuardian() === $this) {
  1268. $earlyPayment->setGuardian(null);
  1269. }
  1270. }
  1271. return $this;
  1272. }
  1273. public function getBalance(): ?float
  1274. {
  1275. return $this->balance;
  1276. }
  1277. public function setBalance(?float $balance): self
  1278. {
  1279. $this->balance = $balance;
  1280. return $this;
  1281. }
  1282. public function getChatStreamToken(): ?string
  1283. {
  1284. return $this->chatStreamToken;
  1285. }
  1286. public function setChatStreamToken(?string $chatStreamToken): self
  1287. {
  1288. $this->chatStreamToken = $chatStreamToken;
  1289. return $this;
  1290. }
  1291. public function isNewPriceEmailSent(): ?bool
  1292. {
  1293. return $this->newPriceEmailSent;
  1294. }
  1295. public function setNewPriceEmailSent(?bool $newPriceEmailSent): self
  1296. {
  1297. $this->newPriceEmailSent = $newPriceEmailSent;
  1298. return $this;
  1299. }
  1300. public function getNewEmailOpened(): ?\DateTimeInterface
  1301. {
  1302. return $this->newEmailOpened;
  1303. }
  1304. public function setNewEmailOpened(?\DateTimeInterface $newEmailOpened): self
  1305. {
  1306. $this->newEmailOpened = $newEmailOpened;
  1307. return $this;
  1308. }
  1309. public function isNewEmailSubmitted(): ?bool
  1310. {
  1311. return $this->newEmailSubmitted;
  1312. }
  1313. public function setNewEmailSubmitted(?bool $newEmailSubmitted): self
  1314. {
  1315. $this->newEmailSubmitted = $newEmailSubmitted;
  1316. return $this;
  1317. }
  1318. public function getMobileAppLastUsedAt(): ?\DateTimeInterface
  1319. {
  1320. return $this->mobileAppLastUsedAt;
  1321. }
  1322. public function setMobileAppLastUsedAt(?\DateTimeInterface $mobileAppLastUsedAt): self
  1323. {
  1324. $this->mobileAppLastUsedAt = $mobileAppLastUsedAt;
  1325. return $this;
  1326. }
  1327. /**
  1328. * @return Collection<int, ChatCensorshipJournal>
  1329. */
  1330. public function getChatCensorshipJournals(): Collection
  1331. {
  1332. return $this->chatCensorshipJournals;
  1333. }
  1334. public function addChatCensorshipJournal(ChatCensorshipJournal $chatCensorshipJournal): self
  1335. {
  1336. if (!$this->chatCensorshipJournals->contains($chatCensorshipJournal)) {
  1337. $this->chatCensorshipJournals[] = $chatCensorshipJournal;
  1338. $chatCensorshipJournal->setGuardian($this);
  1339. }
  1340. return $this;
  1341. }
  1342. public function removeChatCensorshipJournal(ChatCensorshipJournal $chatCensorshipJournal): self
  1343. {
  1344. if ($this->chatCensorshipJournals->removeElement($chatCensorshipJournal)) {
  1345. // set the owning side to null (unless already changed)
  1346. if ($chatCensorshipJournal->getGuardian() === $this) {
  1347. $chatCensorshipJournal->setGuardian(null);
  1348. }
  1349. }
  1350. return $this;
  1351. }
  1352. public function getMarksignName(): ?string
  1353. {
  1354. return $this->marksignName;
  1355. }
  1356. public function setMarksignName(?string $marksignName): self
  1357. {
  1358. $this->marksignName = $marksignName;
  1359. return $this;
  1360. }
  1361. public function getMarksignSurname(): ?string
  1362. {
  1363. return $this->marksignSurname;
  1364. }
  1365. public function setMarksignSurname(?string $marksignSurname): self
  1366. {
  1367. $this->marksignSurname = $marksignSurname;
  1368. return $this;
  1369. }
  1370. }