, * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ namespace Chill\PersonBundle\Entity\AccompanyingPeriod; use Chill\MainBundle\Entity\User; use Chill\PersonBundle\Entity\AccompanyingPeriod; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\Serializer\Annotation\Groups; use Symfony\Component\Serializer\Annotation\DiscriminatorMap; use Chill\MainBundle\Doctrine\Model\TrackCreationInterface; use Chill\MainBundle\Doctrine\Model\TrackUpdateInterface; /** * @ORM\Entity * @ORM\Table(name="chill_person_accompanying_period_comment") * @DiscriminatorMap(typeProperty="type", mapping={ * "accompanying_period_comment"=Comment::class * }) */ class Comment implements TrackCreationInterface, TrackUpdateInterface { /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") * @Groups({"read"}) */ private $id; /** * @ORM\ManyToOne( * targetEntity="Chill\PersonBundle\Entity\AccompanyingPeriod", * inversedBy="comments") * @ORM\JoinColumn(nullable=false, onDelete="CASCADE") */ private $accompanyingPeriod; /** * @ORM\ManyToOne(targetEntity=User::class) * @ORM\JoinColumn(nullable=false) * @Groups({"read"}) */ private $creator; /** * @ORM\Column(type="datetime") * @Groups({"read"}) */ private $createdAt; /** * @ORM\Column(type="datetime") * @Groups({"read"}) */ private $updatedAt; /** * @ORM\ManyToOne(targetEntity=User::class) * @ORM\JoinColumn(nullable=false) * @Groups({"read"}) */ private $updatedBy; /** * @ORM\Column(type="text") * @Groups({"read", "write"}) */ private $content; public function getId(): ?int { return $this->id; } public function getAccompanyingPeriod(): ?AccompanyingPeriod { return $this->accompanyingPeriod; } public function setAccompanyingPeriod(?AccompanyingPeriod $accompanyingPeriod): self { $this->accompanyingPeriod = $accompanyingPeriod; return $this; } public function getCreator(): ?User { return $this->creator; } public function setCreator(?User $creator): self { $this->creator = $creator; return $this; } public function setCreatedBy(User $user): self { return $this->setCreator($user); } public function getCreatedAt(): ?\DateTimeInterface { return $this->createdAt; } public function setCreatedAt(\DateTimeInterface $createdAt): self { $this->createdAt = $createdAt; return $this; } public function getUpdatedAt(): ?\DateTimeInterface { return $this->updatedAt; } public function setUpdatedAt(\DateTimeInterface $updatedAt): self { $this->updatedAt = $updatedAt; return $this; } public function getUpdatedBy(): ?User { return $this->updatedBy; } public function setUpdatedBy(User $updatedBy): self { $this->updatedBy = $updatedBy; return $this; } public function getContent(): ?string { return $this->content; } public function setContent(string $content): self { $this->content = $content; return $this; } }