<?php
namespace App\V4\Model\TaskType;
use ApiPlatform\Core\Annotation\ApiProperty;
use App\Model\IriNormalizableInterface;
use App\Model\NormalizeAsIRITrait;
use App\Model\Traits\ImportableObjectTrait;
use App\Model\Traits\TimestampableTrait;
use App\V4\Model\Task\Task;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Symfony\Component\Serializer\Annotation\Groups;
class TaskType implements IriNormalizableInterface
{
const NAME_REMINDER = 'reminder_quote_automatic';
use TimestampableTrait;
use ImportableObjectTrait;
use NormalizeAsIRITrait;
const CAMPAGNE_TASK_TYPE_NAME = 'Campagne';
/**
* @ApiProperty(identifier=true)
*
* @var string
*
* @Groups({
* "task_type:write", "task_type:update",
* "task:list", "task:read", "task:write", "task:update",
* })
*/
private $id;
/**
* @var string|null
*
* @Groups({
* "task_type:write", "task_type:update",
* "task:list", "task:read", "task:write", "task:update",
* })
*/
private $name;
/**
* @var string|null
*
* @Groups({
* "task_type:write", "task_type:update",
* "task:list", "task:read", "task:write", "task:update",
* })
*/
private $customerId;
/**
* @var string|null
*
* @Groups({
* "task_type:write", "task_type:update",
* "task:list", "task:read", "task:write", "task:update",
* })
*/
private $externalId;
/**
* @var string|null
*
* @Groups({
* "task_type:write", "task_type:update",
* "task:list", "task:read", "task:write", "task:update",
* })
*/
private $code;
/**
* @var bool
*
* @Groups({
* "task_type:write", "task_type:update",
* "task:list", "task:read", "task:write", "task:update",
* })
*/
private $isTimestamped = false;
/**
* @var bool
*
* @Groups({
* "task_type:write", "task_type:update",
* "task:list", "task:read", "task:write", "task:update",
* })
*/
private $isMailing = false;
/**
* @var bool
*
* @Groups({
* "task_type:write", "task_type:update",
* "task:list", "task:read", "task:write", "task:update",
* })
*/
private $isSynchroOutlook = false;
/**
* @var bool
*
* @Groups({
* "task_type:write", "task_type:update",
* "task:list", "task:read", "task:write", "task:update",
* })
*/
private $isReminder = false;
/**
* @var Task[]|Collection
*/
private $tasks;
public function __construct()
{
$this->tasks = new ArrayCollection();
}
/**
* @return string
*/
public function getId(): ?string
{
return $this->id;
}
/**
* @param string|null $id
*
* @return TaskType
*/
public function setId(?string $id): TaskType
{
$this->id = $id;
return $this;
}
/**
* @return string|null
*/
public function getName(): ?string
{
return $this->name;
}
/**
* @param string|null $name
*
* @return TaskType
*/
public function setName(?string $name): TaskType
{
$this->name = $name;
return $this;
}
/**
* @return string|null
*/
public function getCustomerId(): ?string
{
return $this->customerId;
}
/**
* @param string|null $customerId
*
* @return TaskType
*/
public function setCustomerId(?string $customerId): TaskType
{
$this->customerId = $customerId;
return $this;
}
/**
* @return string|null
*/
public function getExternalId(): ?string
{
return $this->externalId;
}
/**
* @param string|null $externalId
*
* @return TaskType
*/
public function setExternalId(?string $externalId): TaskType
{
$this->externalId = $externalId;
return $this;
}
/**
* @return string|null
*/
public function getCode(): ?string
{
return $this->code;
}
/**
* @param string|null $code
*
* @return TaskType
*/
public function setCode(?string $code): TaskType
{
$this->code = $code;
return $this;
}
/**
* @return Task[]|Collection
*/
public function getTasks(): Collection
{
return $this->tasks;
}
/**
* @param Task $task
*
* @return TaskType
*/
public function addTask(Task $task): self
{
if (!$this->tasks->contains($task)) {
$this->tasks->add($task);
$task->setTaskType($this);
}
return $this;
}
/**
* @param Task $task
*
* @return TaskType
*/
public function removeTask(Task $task): self
{
if ($this->tasks->contains($task)) {
$this->tasks->removeElement($task);
// set the owning side to null (unless already changed)
if ($task->getTaskType() === $this) {
$task->setTaskType(null);
}
}
return $this;
}
/**
* @return string|null
*/
public function __toString(): ?string
{
return $this->name;
}
/**
* @return bool
*/
public function isTimestamped(): bool
{
return $this->isTimestamped;
}
/**
* @param bool $isTimestamped
*
* @return TaskType
*/
public function setIsTimestamped(bool $isTimestamped): TaskType
{
$this->isTimestamped = $isTimestamped;
return $this;
}
/**
* @return bool
*/
public function isMailing(): bool
{
return $this->isMailing;
}
/**
* @param bool $isMailing
*
* @return TaskType
*/
public function setIsMailing(bool $isMailing): TaskType
{
$this->isMailing = $isMailing;
return $this;
}
/**
* @return bool
*/
public function isSynchroOutlook(): bool
{
return $this->isSynchroOutlook;
}
/**
* @param bool $isSynchroOutlook
*
* @return TaskType
*/
public function setIsSynchroOutlook(bool $isSynchroOutlook): TaskType
{
$this->isSynchroOutlook = $isSynchroOutlook;
return $this;
}
/**
* @return bool
*/
public function isReminder(): bool
{
return $this->isReminder;
}
/**
* @param bool $isReminder
*
* @return self
*/
public function setIsReminder(bool $isReminder): self
{
$this->isReminder = $isReminder;
return $this;
}
}