src/Entity/SectionRevision.php line 10

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Traits\TimestampableTrait;
  4. use App\Repository\SectionRepository;
  5. use Doctrine\ORM\Mapping as ORM;
  6. #[ORM\Entity(repositoryClassSectionRevisionRepository::class)]
  7. class SectionRevision
  8. {
  9.     use TimestampableTrait;
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column(type'integer')]
  13.     private $id;
  14.     #[ORM\ManyToOne(targetEntitySection::class, inversedBy'sectionRevisions')]
  15.     #[ORM\JoinColumn(onDelete'CASCADE')]
  16.     private $section;
  17.     #[ORM\ManyToOne(targetEntityUser::class, inversedBy'sectionRevisions')]
  18.     #[ORM\JoinColumn(onDelete'SET NULL')]
  19.     private $user;
  20.     #[ORM\Column(type'string'length255)]
  21.     private $name;
  22.     #[ORM\Column(type'text')]
  23.     private $text;
  24.     /**
  25.      * @return int|null
  26.      */
  27.     public function getId(): ?int
  28.     {
  29.         return $this->id;
  30.     }
  31.     /**
  32.      * @return string|null
  33.      */
  34.     public function getName(): ?string
  35.     {
  36.         return $this->name;
  37.     }
  38.     /**
  39.      * @param string $name
  40.      * @return $this
  41.      */
  42.     public function setName(string $name): self
  43.     {
  44.         $this->name $name;
  45.         return $this;
  46.     }
  47.     /**
  48.      * @return string|null
  49.      */
  50.     public function getText(): ?string
  51.     {
  52.         return $this->text;
  53.     }
  54.     /**
  55.      * @param string $text
  56.      * @return $this
  57.      */
  58.     public function setText(string $text): self
  59.     {
  60.         $this->text $text;
  61.         return $this;
  62.     }
  63.     /**
  64.      * @return Section|null
  65.      */
  66.     public function getSection(): ?Section
  67.     {
  68.         return $this->section;
  69.     }
  70.     /**
  71.      * @param Section|null $section
  72.      * @return $this
  73.      */
  74.     public function setSection(?Section $section): self
  75.     {
  76.         $this->section $section;
  77.         return $this;
  78.     }
  79.     /**
  80.      * @return User|null
  81.      */
  82.     public function getUser(): ?User
  83.     {
  84.         return $this->user;
  85.     }
  86.     /**
  87.      * @param User|null $user
  88.      * @return $this
  89.      */
  90.     public function setUser(?User $user): self
  91.     {
  92.         $this->user $user;
  93.         return $this;
  94.     }
  95. }