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.     private ?SchoolYear $year null;
  33.     #[ORM\ManyToOne(inversedBy'docInfos'cascade: ["persist"])]
  34.     private ?User $author null;
  35.     #[ORM\ManyToOne(inversedBy'docInfoUpdated'cascade: ["persist"])]
  36.     private ?User $editor null;
  37.     #[ORM\Column(nullabletrue)]
  38.     private ?bool $toAll null;
  39.     #[ORM\ManyToOne(inversedBy'parentDocInfos'cascade: ["persist"])]
  40.     private ?User $parent null;
  41.     #[ORM\ManyToMany(targetEntityTheClass::class, inversedBy'docInfos'cascade: ['persist''remove'])]
  42.     private Collection $classes;
  43.     #[ORM\ManyToOne(inversedBy'docInfos'cascade: ["persist"])]
  44.     private ?School $school null;
  45.     public function __construct()
  46.     {
  47.         $this->classes = new ArrayCollection();
  48.     }
  49.     public function getId(): ?int
  50.     {
  51.         return $this->id;
  52.     }
  53.     public function getTitle(): ?string
  54.     {
  55.         return $this->title;
  56.     }
  57.     public function setTitle(string $title): static
  58.     {
  59.         $this->title $title;
  60.         return $this;
  61.     }
  62.     public function getContent(): ?string
  63.     {
  64.         return $this->content;
  65.     }
  66.     public function setContent(string $content): static
  67.     {
  68.         $this->content $content;
  69.         return $this;
  70.     }
  71.     
  72.     public function getFileName(): ?string
  73.     {
  74.         return $this->FileName;
  75.     }
  76.     public function setFileName(?string $FileName): static
  77.     {
  78.         $this->FileName $FileName;
  79.         return $this;
  80.     }
  81.     public function getYear(): ?SchoolYear
  82.     {
  83.         return $this->year;
  84.     }
  85.     public function setYear(?SchoolYear $year): static
  86.     {
  87.         $this->year $year;
  88.         return $this;
  89.     }
  90.     public function getAuthor(): ?User
  91.     {
  92.         return $this->author;
  93.     }
  94.     public function setAuthor(?User $author): static
  95.     {
  96.         $this->author $author;
  97.         return $this;
  98.     }
  99.     public function getEditor(): ?User
  100.     {
  101.         return $this->editor;
  102.     }
  103.     public function setEditor(?User $editor): static
  104.     {
  105.         $this->editor $editor;
  106.         return $this;
  107.     }
  108.     public function isToAll(): ?bool
  109.     {
  110.         return $this->toAll;
  111.     }
  112.     public function setToAll(?bool $toAll): static
  113.     {
  114.         $this->toAll $toAll;
  115.         return $this;
  116.     }
  117.     public function getParent(): ?User
  118.     {
  119.         return $this->parent;
  120.     }
  121.     public function setParent(?User $parent): static
  122.     {
  123.         $this->parent $parent;
  124.         return $this;
  125.     }
  126.     /**
  127.      * @return Collection<int, TheClass>
  128.      */
  129.     public function getClasses(): Collection
  130.     {
  131.         return $this->classes;
  132.     }
  133.     public function addClass(TheClass $class): static
  134.     {
  135.         if (!$this->classes->contains($class)) {
  136.             $this->classes->add($class);
  137.         }
  138.         return $this;
  139.     }
  140.     public function removeClass(TheClass $class): static
  141.     {
  142.         $this->classes->removeElement($class);
  143.         return $this;
  144.     }
  145.     public function getSchool(): ?School
  146.     {
  147.         return $this->school;
  148.     }
  149.     public function setSchool(?School $school): static
  150.     {
  151.         $this->school $school;
  152.         return $this;
  153.     }
  154. }