['task_recurrence:read']], denormalizationContext: ['groups' => ['task_recurrence:write']], )] #[ORM\Entity(repositoryClass: TaskRecurrenceRepository::class)] class TaskRecurrence { #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column] #[Groups(['task_recurrence:read', 'task:read'])] private ?int $id = null; #[ORM\Column(type: 'string', enumType: RecurrenceType::class)] #[Groups(['task_recurrence:read', 'task_recurrence:write', 'task:read'])] private ?RecurrenceType $type = null; #[ORM\Column(type: 'integer')] #[Groups(['task_recurrence:read', 'task_recurrence:write', 'task:read'])] private int $interval = 1; #[ORM\Column(type: 'json', nullable: true)] #[Groups(['task_recurrence:read', 'task_recurrence:write', 'task:read'])] private ?array $daysOfWeek = null; #[ORM\Column(type: 'integer', nullable: true)] #[Groups(['task_recurrence:read', 'task_recurrence:write', 'task:read'])] private ?int $dayOfMonth = null; #[ORM\Column(type: 'integer', nullable: true)] #[Groups(['task_recurrence:read', 'task_recurrence:write', 'task:read'])] private ?int $weekOfMonth = null; #[ORM\Column(type: 'date_immutable', nullable: true)] #[Groups(['task_recurrence:read', 'task_recurrence:write', 'task:read'])] private ?DateTimeImmutable $endDate = null; #[ORM\Column(type: 'integer', nullable: true)] #[Groups(['task_recurrence:read', 'task_recurrence:write', 'task:read'])] private ?int $maxOccurrences = null; #[ORM\Column(type: 'integer')] #[Groups(['task_recurrence:read'])] private int $occurrenceCount = 0; #[ORM\Version] #[ORM\Column(type: 'integer')] private int $version = 1; /** @var Collection */ #[ORM\OneToMany(targetEntity: Task::class, mappedBy: 'recurrence')] private Collection $tasks; public function __construct() { $this->tasks = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getType(): ?RecurrenceType { return $this->type; } public function setType(RecurrenceType $type): static { $this->type = $type; return $this; } public function getInterval(): int { return $this->interval; } public function setInterval(int $interval): static { $this->interval = $interval; return $this; } public function getDaysOfWeek(): ?array { return $this->daysOfWeek; } public function setDaysOfWeek(?array $daysOfWeek): static { $this->daysOfWeek = $daysOfWeek; return $this; } public function getDayOfMonth(): ?int { return $this->dayOfMonth; } public function setDayOfMonth(?int $dayOfMonth): static { $this->dayOfMonth = $dayOfMonth; return $this; } public function getWeekOfMonth(): ?int { return $this->weekOfMonth; } public function setWeekOfMonth(?int $weekOfMonth): static { $this->weekOfMonth = $weekOfMonth; return $this; } public function getEndDate(): ?DateTimeImmutable { return $this->endDate; } public function setEndDate(?DateTimeImmutable $endDate): static { $this->endDate = $endDate; return $this; } public function getMaxOccurrences(): ?int { return $this->maxOccurrences; } public function setMaxOccurrences(?int $maxOccurrences): static { $this->maxOccurrences = $maxOccurrences; return $this; } public function getOccurrenceCount(): int { return $this->occurrenceCount; } public function getVersion(): int { return $this->version; } /** @return Collection */ public function getTasks(): Collection { return $this->tasks; } public function incrementOccurrenceCount(): static { ++$this->occurrenceCount; return $this; } }