*/ #[ORM\ManyToMany(targetEntity: Command::class, inversedBy: 'commandTasks')] private Collection $commands; /** * @var Collection */ #[ORM\ManyToMany(targetEntity: CommandGroup::class, inversedBy: 'commandTasks')] private Collection $commandGroups; #[ORM\Column(type: Types::DATETIME_MUTABLE)] private ?\DateTimeInterface $datetime = null; #[ORM\Column(length: 255, nullable: true)] private ?string $notes = null; #[ORM\Column(length: 255)] private ?string $status = null; /** * @var Collection */ #[ORM\ManyToMany(targetEntity: Client::class)] private Collection $clients; public function __construct() { parent::__construct(); $this->commands = new ArrayCollection(); $this->commandGroups = new ArrayCollection(); $this->clients = new ArrayCollection(); } /** * @return Collection */ public function getCommands(): Collection { return $this->commands; } public function setCommands(array $commands): static { $this->commands->clear(); foreach ($commands as $command){ $this->addCommand($command); } return $this; } public function addCommand(Command $command): static { if (!$this->commands->contains($command)) { $this->commands->add($command); } return $this; } public function removeCommand(Command $command): static { $this->commands->removeElement($command); return $this; } /** * @return Collection */ public function getCommandGroups(): Collection { return $this->commandGroups; } public function setCommandGroups(array $commandGroups): static { $this->commandGroups->clear(); foreach ($commandGroups as $commandGroup){ $this->addCommandGroup($commandGroup); } return $this; } public function addCommandGroup(CommandGroup $commandGroup): static { if (!$this->commandGroups->contains($commandGroup)) { $this->commandGroups->add($commandGroup); } return $this; } public function removeCommandGroup(CommandGroup $commandGroup): static { $this->commandGroups->removeElement($commandGroup); return $this; } public function getDatetime(): ?\DateTimeInterface { return $this->datetime; } public function setDatetime(\DateTimeInterface $datetime): static { $this->datetime = $datetime; return $this; } public function getNotes(): ?string { return $this->notes; } public function setNotes(?string $notes): static { $this->notes = $notes; return $this; } public function getStatus(): ?string { return $this->status; } public function setStatus(string $status): static { $this->status = $status; return $this; } /** * @return Collection */ public function getClients(): Collection { return $this->clients; } public function addClient(Client $client): static { if (!$this->clients->contains($client)) { $this->clients->add($client); } return $this; } public function removeClient(Client $client): static { $this->clients->removeElement($client); return $this; } public function setClients(array $clients): static { $this->clients->clear(); foreach ($clients as $client){ $this->addClient($client); } return $this; } }