src/Entity/AdminConfirmation.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\AdminConfirmationRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Component\Serializer\Annotation\Groups;
  6. /**
  7. * @ORM\Entity(repositoryClass=AdminConfirmationRepository::class)
  8. */
  9. class AdminConfirmation
  10. {
  11. const ACTION_CANCEL_DELETION = [
  12. 'value' => "cancelDeletion",
  13. 'text' => 'Atkurti užsiėmimą',
  14. ];
  15. const ACTION_CANCEL_EXTRA_LESSON = [
  16. 'value' => "cancelExtraLesson",
  17. 'text' => 'Ištrinti užsiėmimą',
  18. ];
  19. const ACTION_CANCEL_CHILD_PREFERENCE = [
  20. 'value' => "cancelChildPreference",
  21. 'text' => '2) Keisti užsiėmimų laikus',
  22. ];
  23. const ACTION_CALL_GUARDIAN = [
  24. 'value' => "callGuardian",
  25. 'text' => '1) Paskambinti klientui',
  26. ];
  27. const ACTION_REMOVE_CLASS = [
  28. 'value' => "removeClass",
  29. 'text' => 'Nebegaliu mokyti klasės',
  30. ];
  31. const ACTION_REMOVE_DISCIPLINE = [
  32. 'value' => "removeDiscipline",
  33. 'text' => 'Nebegaliu mokyti disciplinos',
  34. ];
  35. const ACTION_REMOVE_CHILD_PREFERENCE = [
  36. 'value' => "removeChildPreference",
  37. 'text' => 'Mokinio atsisakymas',
  38. ];
  39. const ACTIONS = [
  40. self::ACTION_CANCEL_DELETION,
  41. self::ACTION_CANCEL_EXTRA_LESSON,
  42. self::ACTION_CANCEL_CHILD_PREFERENCE,
  43. self::ACTION_CALL_GUARDIAN,
  44. self::ACTION_REMOVE_CLASS,
  45. self::ACTION_REMOVE_DISCIPLINE,
  46. self::ACTION_REMOVE_CHILD_PREFERENCE,
  47. ];
  48. //cancelDeletion
  49. //cancelExtraLesson
  50. //cancelChildPreference
  51. /**
  52. * @ORM\Id
  53. * @ORM\GeneratedValue
  54. * @ORM\Column(type="integer")
  55. * @Groups({"AdminConfirmationsList"})
  56. */
  57. private $id;
  58. /**
  59. * @ORM\Column(type="string", length=255, nullable=true)
  60. * @Groups({"AdminConfirmationsList"})
  61. */
  62. private $action;
  63. /**
  64. * @ORM\Column(type="integer", nullable=true)
  65. * @Groups({"AdminConfirmationsList"})
  66. */
  67. private $objectId;
  68. /**
  69. * @ORM\Column(type="datetime", nullable=true)
  70. * @Groups({"AdminConfirmationsList"})
  71. */
  72. private $createdAt;
  73. /**
  74. * @ORM\ManyToOne(targetEntity=Guardian::class, inversedBy="adminConfirmations")
  75. * @Groups({"AdminConfirmationsList"})
  76. */
  77. private $guardian;
  78. /**
  79. * @ORM\Column(type="text", nullable=true)
  80. * @Groups({"AdminConfirmationsList"})
  81. */
  82. private $comment;
  83. /**
  84. * @ORM\ManyToOne(targetEntity=Admin::class)
  85. * @Groups({"AdminConfirmationsList"})
  86. */
  87. private $admin;
  88. /**
  89. * @ORM\Column(type="boolean", nullable=true)
  90. * @Groups({"AdminConfirmationsList"})
  91. */
  92. private $isDone;
  93. /**
  94. * @ORM\Column(type="datetime", nullable=true)
  95. * @Groups({"AdminConfirmationsList"})
  96. */
  97. private $completedAt;
  98. /**
  99. * @ORM\ManyToOne(targetEntity=Admin::class)
  100. * @Groups({"AdminConfirmationsList"})
  101. */
  102. private $completedByAdmin;
  103. /**
  104. * @ORM\ManyToOne(targetEntity=Teacher::class)
  105. * @Groups({"AdminConfirmationsList"})
  106. */
  107. private $teacher;
  108. public function __construct()
  109. {
  110. $this->createdAt = new \DateTime();
  111. }
  112. public function getId(): ?int
  113. {
  114. return $this->id;
  115. }
  116. public function getAction(): ?string
  117. {
  118. return $this->action;
  119. }
  120. public function getActionText(): ?string
  121. {
  122. foreach (self::ACTIONS as $action) {
  123. if ($action['value'] == $this->action) {
  124. return $action['text'];
  125. }
  126. }
  127. return $this->action;
  128. }
  129. public function setAction(?string $action): self
  130. {
  131. $this->action = $action;
  132. return $this;
  133. }
  134. public function getObjectId(): ?int
  135. {
  136. return $this->objectId;
  137. }
  138. public function setObjectId(?int $objectId): self
  139. {
  140. $this->objectId = $objectId;
  141. return $this;
  142. }
  143. public function getCreatedAt(): ?\DateTimeInterface
  144. {
  145. return $this->createdAt;
  146. }
  147. public function setCreatedAt(?\DateTimeInterface $createdAt): self
  148. {
  149. $this->createdAt = $createdAt;
  150. return $this;
  151. }
  152. public function getGuardian(): ?Guardian
  153. {
  154. return $this->guardian;
  155. }
  156. public function setGuardian(?Guardian $guardian): self
  157. {
  158. $this->guardian = $guardian;
  159. return $this;
  160. }
  161. public function getComment(): ?string
  162. {
  163. return $this->comment;
  164. }
  165. public function setComment(?string $comment): self
  166. {
  167. $this->comment = $comment;
  168. return $this;
  169. }
  170. public function getAdmin(): ?Admin
  171. {
  172. return $this->admin;
  173. }
  174. public function setAdmin(?Admin $admin): self
  175. {
  176. $this->admin = $admin;
  177. return $this;
  178. }
  179. public function isIsDone(): ?bool
  180. {
  181. return $this->isDone;
  182. }
  183. public function setIsDone(?bool $isDone): self
  184. {
  185. $this->isDone = $isDone;
  186. return $this;
  187. }
  188. public function getCompletedAt(): ?\DateTimeInterface
  189. {
  190. return $this->completedAt;
  191. }
  192. public function setCompletedAt(?\DateTimeInterface $completedAt): self
  193. {
  194. $this->completedAt = $completedAt;
  195. return $this;
  196. }
  197. public function getCompletedByAdmin(): ?Admin
  198. {
  199. return $this->completedByAdmin;
  200. }
  201. public function setCompletedByAdmin(?Admin $completedByAdmin): self
  202. {
  203. $this->completedByAdmin = $completedByAdmin;
  204. return $this;
  205. }
  206. public function getTeacher(): ?Teacher
  207. {
  208. return $this->teacher;
  209. }
  210. public function setTeacher(?Teacher $teacher): self
  211. {
  212. $this->teacher = $teacher;
  213. return $this;
  214. }
  215. }