<?php
namespace App\Entity;
use App\Repository\AdminConfirmationRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Groups;
/**
* @ORM\Entity(repositoryClass=AdminConfirmationRepository::class)
*/
class AdminConfirmation
{
const ACTION_CANCEL_DELETION = [
'value' => "cancelDeletion",
'text' => 'Atkurti užsiėmimą',
];
const ACTION_CANCEL_EXTRA_LESSON = [
'value' => "cancelExtraLesson",
'text' => 'Ištrinti užsiėmimą',
];
const ACTION_CANCEL_CHILD_PREFERENCE = [
'value' => "cancelChildPreference",
'text' => '2) Keisti užsiėmimų laikus',
];
const ACTION_CALL_GUARDIAN = [
'value' => "callGuardian",
'text' => '1) Paskambinti klientui',
];
const ACTION_REMOVE_CLASS = [
'value' => "removeClass",
'text' => 'Nebegaliu mokyti klasės',
];
const ACTION_REMOVE_DISCIPLINE = [
'value' => "removeDiscipline",
'text' => 'Nebegaliu mokyti disciplinos',
];
const ACTION_REMOVE_CHILD_PREFERENCE = [
'value' => "removeChildPreference",
'text' => 'Mokinio atsisakymas',
];
const ACTIONS = [
self::ACTION_CANCEL_DELETION,
self::ACTION_CANCEL_EXTRA_LESSON,
self::ACTION_CANCEL_CHILD_PREFERENCE,
self::ACTION_CALL_GUARDIAN,
self::ACTION_REMOVE_CLASS,
self::ACTION_REMOVE_DISCIPLINE,
self::ACTION_REMOVE_CHILD_PREFERENCE,
];
//cancelDeletion
//cancelExtraLesson
//cancelChildPreference
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
* @Groups({"AdminConfirmationsList"})
*/
private $id;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Groups({"AdminConfirmationsList"})
*/
private $action;
/**
* @ORM\Column(type="integer", nullable=true)
* @Groups({"AdminConfirmationsList"})
*/
private $objectId;
/**
* @ORM\Column(type="datetime", nullable=true)
* @Groups({"AdminConfirmationsList"})
*/
private $createdAt;
/**
* @ORM\ManyToOne(targetEntity=Guardian::class, inversedBy="adminConfirmations")
* @Groups({"AdminConfirmationsList"})
*/
private $guardian;
/**
* @ORM\Column(type="text", nullable=true)
* @Groups({"AdminConfirmationsList"})
*/
private $comment;
/**
* @ORM\ManyToOne(targetEntity=Admin::class)
* @Groups({"AdminConfirmationsList"})
*/
private $admin;
/**
* @ORM\Column(type="boolean", nullable=true)
* @Groups({"AdminConfirmationsList"})
*/
private $isDone;
/**
* @ORM\Column(type="datetime", nullable=true)
* @Groups({"AdminConfirmationsList"})
*/
private $completedAt;
/**
* @ORM\ManyToOne(targetEntity=Admin::class)
* @Groups({"AdminConfirmationsList"})
*/
private $completedByAdmin;
/**
* @ORM\ManyToOne(targetEntity=Teacher::class)
* @Groups({"AdminConfirmationsList"})
*/
private $teacher;
public function __construct()
{
$this->createdAt = new \DateTime();
}
public function getId(): ?int
{
return $this->id;
}
public function getAction(): ?string
{
return $this->action;
}
public function getActionText(): ?string
{
foreach (self::ACTIONS as $action) {
if ($action['value'] == $this->action) {
return $action['text'];
}
}
return $this->action;
}
public function setAction(?string $action): self
{
$this->action = $action;
return $this;
}
public function getObjectId(): ?int
{
return $this->objectId;
}
public function setObjectId(?int $objectId): self
{
$this->objectId = $objectId;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(?\DateTimeInterface $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function getGuardian(): ?Guardian
{
return $this->guardian;
}
public function setGuardian(?Guardian $guardian): self
{
$this->guardian = $guardian;
return $this;
}
public function getComment(): ?string
{
return $this->comment;
}
public function setComment(?string $comment): self
{
$this->comment = $comment;
return $this;
}
public function getAdmin(): ?Admin
{
return $this->admin;
}
public function setAdmin(?Admin $admin): self
{
$this->admin = $admin;
return $this;
}
public function isIsDone(): ?bool
{
return $this->isDone;
}
public function setIsDone(?bool $isDone): self
{
$this->isDone = $isDone;
return $this;
}
public function getCompletedAt(): ?\DateTimeInterface
{
return $this->completedAt;
}
public function setCompletedAt(?\DateTimeInterface $completedAt): self
{
$this->completedAt = $completedAt;
return $this;
}
public function getCompletedByAdmin(): ?Admin
{
return $this->completedByAdmin;
}
public function setCompletedByAdmin(?Admin $completedByAdmin): self
{
$this->completedByAdmin = $completedByAdmin;
return $this;
}
public function getTeacher(): ?Teacher
{
return $this->teacher;
}
public function setTeacher(?Teacher $teacher): self
{
$this->teacher = $teacher;
return $this;
}
}