src/V4/Model/TaskType/TaskType.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\V4\Model\TaskType;
  3. use ApiPlatform\Core\Annotation\ApiProperty;
  4. use App\Model\IriNormalizableInterface;
  5. use App\Model\NormalizeAsIRITrait;
  6. use App\Model\Traits\ImportableObjectTrait;
  7. use App\Model\Traits\TimestampableTrait;
  8. use App\V4\Model\Task\Task;
  9. use Doctrine\Common\Collections\ArrayCollection;
  10. use Doctrine\Common\Collections\Collection;
  11. use Symfony\Component\Serializer\Annotation\Groups;
  12. class TaskType implements IriNormalizableInterface
  13. {
  14.     const NAME_REMINDER 'reminder_quote_automatic';
  15.     use TimestampableTrait;
  16.     use ImportableObjectTrait;
  17.     use NormalizeAsIRITrait;
  18.     const CAMPAGNE_TASK_TYPE_NAME 'Campagne';
  19.     /**
  20.      * @ApiProperty(identifier=true)
  21.      *
  22.      * @var string
  23.      *
  24.      * @Groups({
  25.      *     "task_type:write", "task_type:update",
  26.      *     "task:list", "task:read", "task:write", "task:update",
  27.      * })
  28.      */
  29.     private $id;
  30.     /**
  31.      * @var string|null
  32.      *
  33.      * @Groups({
  34.      *     "task_type:write", "task_type:update",
  35.      *     "task:list", "task:read", "task:write", "task:update",
  36.      * })
  37.      */
  38.     private $name;
  39.     /**
  40.      * @var string|null
  41.      *
  42.      * @Groups({
  43.      *     "task_type:write", "task_type:update",
  44.      *     "task:list", "task:read", "task:write", "task:update",
  45.      * })
  46.      */
  47.     private $customerId;
  48.     /**
  49.      * @var string|null
  50.      *
  51.      * @Groups({
  52.      *     "task_type:write", "task_type:update",
  53.      *     "task:list", "task:read", "task:write", "task:update",
  54.      * })
  55.      */
  56.     private $externalId;
  57.     /**
  58.      * @var string|null
  59.      *
  60.      * @Groups({
  61.      *     "task_type:write", "task_type:update",
  62.      *     "task:list", "task:read", "task:write", "task:update",
  63.      * })
  64.      */
  65.     private $code;
  66.     /**
  67.      * @var bool
  68.      *
  69.      * @Groups({
  70.      *     "task_type:write", "task_type:update",
  71.      *     "task:list", "task:read", "task:write", "task:update",
  72.      * })
  73.      */
  74.     private $isTimestamped false;
  75.     /**
  76.      * @var bool
  77.      *
  78.      * @Groups({
  79.      *     "task_type:write", "task_type:update",
  80.      *     "task:list", "task:read", "task:write", "task:update",
  81.      * })
  82.      */
  83.     private $isMailing false;
  84.     /**
  85.      * @var bool
  86.      *
  87.      * @Groups({
  88.      *     "task_type:write", "task_type:update",
  89.      *     "task:list", "task:read", "task:write", "task:update",
  90.      * })
  91.      */
  92.     private $isSynchroOutlook false;
  93.     /**
  94.      * @var bool
  95.      *
  96.      * @Groups({
  97.      *     "task_type:write", "task_type:update",
  98.      *     "task:list", "task:read", "task:write", "task:update",
  99.      * })
  100.      */
  101.     private $isReminder false;
  102.     /**
  103.      * @var Task[]|Collection
  104.      */
  105.     private $tasks;
  106.     public function __construct()
  107.     {
  108.         $this->tasks = new ArrayCollection();
  109.     }
  110.     /**
  111.      * @return string
  112.      */
  113.     public function getId(): ?string
  114.     {
  115.         return $this->id;
  116.     }
  117.     /**
  118.      * @param string|null $id
  119.      *
  120.      * @return TaskType
  121.      */
  122.     public function setId(?string $id): TaskType
  123.     {
  124.         $this->id $id;
  125.         return $this;
  126.     }
  127.     /**
  128.      * @return string|null
  129.      */
  130.     public function getName(): ?string
  131.     {
  132.         return $this->name;
  133.     }
  134.     /**
  135.      * @param string|null $name
  136.      *
  137.      * @return TaskType
  138.      */
  139.     public function setName(?string $name): TaskType
  140.     {
  141.         $this->name $name;
  142.         return $this;
  143.     }
  144.     /**
  145.      * @return string|null
  146.      */
  147.     public function getCustomerId(): ?string
  148.     {
  149.         return $this->customerId;
  150.     }
  151.     /**
  152.      * @param string|null $customerId
  153.      *
  154.      * @return TaskType
  155.      */
  156.     public function setCustomerId(?string $customerId): TaskType
  157.     {
  158.         $this->customerId $customerId;
  159.         return $this;
  160.     }
  161.     /**
  162.      * @return string|null
  163.      */
  164.     public function getExternalId(): ?string
  165.     {
  166.         return $this->externalId;
  167.     }
  168.     /**
  169.      * @param string|null $externalId
  170.      *
  171.      * @return TaskType
  172.      */
  173.     public function setExternalId(?string $externalId): TaskType
  174.     {
  175.         $this->externalId $externalId;
  176.         return $this;
  177.     }
  178.     /**
  179.      * @return string|null
  180.      */
  181.     public function getCode(): ?string
  182.     {
  183.         return $this->code;
  184.     }
  185.     /**
  186.      * @param string|null $code
  187.      *
  188.      * @return TaskType
  189.      */
  190.     public function setCode(?string $code): TaskType
  191.     {
  192.         $this->code $code;
  193.         return $this;
  194.     }
  195.     /**
  196.      * @return Task[]|Collection
  197.      */
  198.     public function getTasks(): Collection
  199.     {
  200.         return $this->tasks;
  201.     }
  202.     /**
  203.      * @param Task $task
  204.      *
  205.      * @return TaskType
  206.      */
  207.     public function addTask(Task $task): self
  208.     {
  209.         if (!$this->tasks->contains($task)) {
  210.             $this->tasks->add($task);
  211.             $task->setTaskType($this);
  212.         }
  213.         return $this;
  214.     }
  215.     /**
  216.      * @param Task $task
  217.      *
  218.      * @return TaskType
  219.      */
  220.     public function removeTask(Task $task): self
  221.     {
  222.         if ($this->tasks->contains($task)) {
  223.             $this->tasks->removeElement($task);
  224.             // set the owning side to null (unless already changed)
  225.             if ($task->getTaskType() === $this) {
  226.                 $task->setTaskType(null);
  227.             }
  228.         }
  229.         return $this;
  230.     }
  231.     /**
  232.      * @return string|null
  233.      */
  234.     public function __toString(): ?string
  235.     {
  236.         return $this->name;
  237.     }
  238.     /**
  239.      * @return bool
  240.      */
  241.     public function isTimestamped(): bool
  242.     {
  243.         return $this->isTimestamped;
  244.     }
  245.     /**
  246.      * @param bool $isTimestamped
  247.      *
  248.      * @return TaskType
  249.      */
  250.     public function setIsTimestamped(bool $isTimestamped): TaskType
  251.     {
  252.         $this->isTimestamped $isTimestamped;
  253.         return $this;
  254.     }
  255.     /**
  256.      * @return bool
  257.      */
  258.     public function isMailing(): bool
  259.     {
  260.         return $this->isMailing;
  261.     }
  262.     /**
  263.      * @param bool $isMailing
  264.      *
  265.      * @return TaskType
  266.      */
  267.     public function setIsMailing(bool $isMailing): TaskType
  268.     {
  269.         $this->isMailing $isMailing;
  270.         return $this;
  271.     }
  272.     /**
  273.      * @return bool
  274.      */
  275.     public function isSynchroOutlook(): bool
  276.     {
  277.         return $this->isSynchroOutlook;
  278.     }
  279.     /**
  280.      * @param bool $isSynchroOutlook
  281.      *
  282.      * @return TaskType
  283.      */
  284.     public function setIsSynchroOutlook(bool $isSynchroOutlook): TaskType
  285.     {
  286.         $this->isSynchroOutlook $isSynchroOutlook;
  287.         return $this;
  288.     }
  289.     /**
  290.      * @return bool
  291.      */
  292.     public function isReminder(): bool
  293.     {
  294.         return $this->isReminder;
  295.     }
  296.     /**
  297.      * @param bool $isReminder
  298.      *
  299.      * @return self
  300.      */
  301.     public function setIsReminder(bool $isReminder): self
  302.     {
  303.         $this->isReminder $isReminder;
  304.         return $this;
  305.     }
  306. }