src/Entity/DocInfo.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\DocInfoRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use App\Entity\Traits\Timestampable;
  9. use JMS\Serializer\Annotation\Groups;
  10. #[ORM\Table(name"doc_info")]
  11. #[ORM\Index(columns: ["title","content"], name"doc_info",flags: ['fulltext'])]
  12. #[ORM\HasLifecycleCallbacks]
  13. #[ORM\Entity(repositoryClassDocInfoRepository::class)]
  14. class DocInfo
  15. {
  16.     use Timestampable;
  17.     #[ORM\Id]
  18.     #[ORM\GeneratedValue]
  19.     #[ORM\Column]
  20.     #[Groups(['getDoc'])]
  21.     private ?int $id null;
  22.     #[ORM\Column(length255)]
  23.     #[Groups(['getDoc'])]
  24.     private ?string $title null;
  25.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  26.     #[Groups(['getDoc'])]
  27.     private ?string $content null;
  28.     #[ORM\Column(length255nullabletrue)]
  29.     #[Groups(['getDoc'])]
  30.     private ?string $FileName null;
  31.     #[ORM\ManyToOne(inversedBy'docInfos'cascade: ["persist"])]
  32.     #[Groups(['getDoc'])]
  33.     private ?SchoolYear $year null;
  34.     #[ORM\ManyToOne(inversedBy'docInfos'cascade: ["persist"])]
  35.     private ?User $author null;
  36.     #[ORM\ManyToOne(inversedBy'docInfoUpdated'cascade: ["persist"])]
  37.     private ?User $editor null;
  38.     #[ORM\Column(nullabletrue)]
  39.     private ?bool $toAll null;
  40.     #[ORM\ManyToOne(inversedBy'parentDocInfos'cascade: ["persist"])]
  41.     private ?User $parent null;
  42.     #[ORM\ManyToMany(targetEntityTheClass::class, inversedBy'docInfos'cascade: ['persist''remove'])]
  43.     private Collection $classes;
  44.     #[ORM\ManyToOne(inversedBy'docInfos'cascade: ["persist"])]
  45.     private ?School $school null;
  46.     public function __construct()
  47.     {
  48.         $this->classes = new ArrayCollection();
  49.     }
  50.     public function getId(): ?int
  51.     {
  52.         return $this->id;
  53.     }
  54.     public function getTitle(): ?string
  55.     {
  56.         return $this->title;
  57.     }
  58.     public function setTitle(string $title): static
  59.     {
  60.         $this->title $title;
  61.         return $this;
  62.     }
  63.     public function getContent(): ?string
  64.     {
  65.         return $this->content;
  66.     }
  67.     public function setContent(string $content): static
  68.     {
  69.         $this->content $content;
  70.         return $this;
  71.     }
  72.     
  73.     public function getFileName(): ?string
  74.     {
  75.         return $this->FileName;
  76.     }
  77.     public function setFileName(?string $FileName): static
  78.     {
  79.         $this->FileName $FileName;
  80.         return $this;
  81.     }
  82.     public function getYear(): ?SchoolYear
  83.     {
  84.         return $this->year;
  85.     }
  86.     public function setYear(?SchoolYear $year): static
  87.     {
  88.         $this->year $year;
  89.         return $this;
  90.     }
  91.     public function getAuthor(): ?User
  92.     {
  93.         return $this->author;
  94.     }
  95.     public function setAuthor(?User $author): static
  96.     {
  97.         $this->author $author;
  98.         return $this;
  99.     }
  100.     public function getEditor(): ?User
  101.     {
  102.         return $this->editor;
  103.     }
  104.     public function setEditor(?User $editor): static
  105.     {
  106.         $this->editor $editor;
  107.         return $this;
  108.     }
  109.     public function isToAll(): ?bool
  110.     {
  111.         return $this->toAll;
  112.     }
  113.     public function setToAll(?bool $toAll): static
  114.     {
  115.         $this->toAll $toAll;
  116.         return $this;
  117.     }
  118.     public function getParent(): ?User
  119.     {
  120.         return $this->parent;
  121.     }
  122.     public function setParent(?User $parent): static
  123.     {
  124.         $this->parent $parent;
  125.         return $this;
  126.     }
  127.     /**
  128.      * @return Collection<int, TheClass>
  129.      */
  130.     public function getClasses(): Collection
  131.     {
  132.         return $this->classes;
  133.     }
  134.     public function addClass(TheClass $class): static
  135.     {
  136.         if (!$this->classes->contains($class)) {
  137.             $this->classes->add($class);
  138.         }
  139.         return $this;
  140.     }
  141.     public function removeClass(TheClass $class): static
  142.     {
  143.         $this->classes->removeElement($class);
  144.         return $this;
  145.     }
  146.     public function getSchool(): ?School
  147.     {
  148.         return $this->school;
  149.     }
  150.     public function setSchool(?School $school): static
  151.     {
  152.         $this->school $school;
  153.         return $this;
  154.     }
  155. }