src/Entity/WebEngine.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * @ORM\Entity(repositoryClass="App\Repository\WebEngineRepository")
  8.  */
  9. class WebEngine
  10. {
  11.     /**
  12.      * @ORM\Id()
  13.      * @ORM\GeneratedValue()
  14.      * @ORM\Column(type="integer")
  15.      */
  16.     private $id;
  17.     /**
  18.      * @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Nom du moteur"})
  19.      */
  20.     private $name;
  21.     /**
  22.      * @ORM\Column(type="boolean", nullable=true, options={"comment":"True si la premiere section alimente la zone des filtres rapides)"})
  23.      */
  24.     private $useFirstSectionForQuickFilters;
  25.     /**
  26.      * @var \Doctrine\Common\Collections\Collection
  27.      *
  28.      * @ORM\OneToMany(targetEntity="App\Entity\WebEngineSection", mappedBy="engine", cascade={"persist","remove"})
  29.      * @ORM\OrderBy({"ordering" = "ASC"})
  30.      */
  31.     private $sections;
  32.     /**
  33.      * @var \Doctrine\Common\Collections\Collection
  34.      *
  35.      * @ORM\OneToMany(targetEntity="App\Entity\WebList", mappedBy="webEngine", cascade={"persist"})
  36.      */
  37.     private $webLists;
  38.     /**
  39.      * @ORM\ManyToOne(targetEntity="App\Entity\User", inversedBy="webEngines")
  40.      * @ORM\JoinColumns({
  41.      *   @ORM\JoinColumn(name="owner_id", referencedColumnName="id")
  42.      * })
  43.      */
  44.     private $owner;
  45.     /**
  46.      * @ORM\ManyToOne(targetEntity="App\Entity\DnsitEntity", inversedBy="webEngines")
  47.      * @ORM\JoinColumns({
  48.      *   @ORM\JoinColumn(name="entity_id", referencedColumnName="id")
  49.      * })
  50.      */
  51.     private $entity;
  52.     /**
  53.      * @ORM\ManyToMany(targetEntity="App\Entity\Tag", inversedBy="webEngines")
  54.      */
  55.     private $tags;
  56.     /**
  57.      * @ORM\Column(type="datetime", nullable=true)
  58.      */
  59.     private $createdAt;
  60.     /**
  61.      * @ORM\Column(type="datetime", nullable=true)
  62.      */
  63.     private $updatedAt;
  64.     /**
  65.      * @ORM\Column(type="integer", nullable=true, options={"default":0, "comment":"code de statut : 0=OK"})
  66.      */
  67.     private $state;
  68.     public function __construct()
  69.     {
  70.         $this->sections = new ArrayCollection();
  71.         $this->webLists = new ArrayCollection();
  72.         $this->tags = new ArrayCollection();
  73.     }
  74.     public function getId() : ?int
  75.     {
  76.         return $this->id;
  77.     }
  78.     public function getName() : ?string
  79.     {
  80.         return $this->name;
  81.     }
  82.     public function setName(?string $name) : self
  83.     {
  84.         $this->name $name;
  85.         return $this;
  86.     }
  87.     public function getCreatedAt() : ?\DateTimeInterface
  88.     {
  89.         return $this->createdAt;
  90.     }
  91.     public function setCreatedAt(?\DateTimeInterface $createdAt) : self
  92.     {
  93.         $this->createdAt $createdAt;
  94.         return $this;
  95.     }
  96.     public function getUpdatedAt() : ?\DateTimeInterface
  97.     {
  98.         return $this->updatedAt;
  99.     }
  100.     public function setUpdatedAt(?\DateTimeInterface $updatedAt) : self
  101.     {
  102.         $this->updatedAt $updatedAt;
  103.         return $this;
  104.     }
  105.     public function getState() : ?int
  106.     {
  107.         return $this->state;
  108.     }
  109.     public function setState(?int $state) : self
  110.     {
  111.         $this->state $state;
  112.         return $this;
  113.     }
  114.     public function getOwner() : ?User
  115.     {
  116.         return $this->owner;
  117.     }
  118.     public function setOwner(?User $owner) : self
  119.     {
  120.         $this->owner $owner;
  121.         return $this;
  122.     }
  123.     public function getEntity() : ?DnsitEntity
  124.     {
  125.         return $this->entity;
  126.     }
  127.     public function setEntity(?DnsitEntity $entity) : self
  128.     {
  129.         $this->entity $entity;
  130.         return $this;
  131.     }
  132.     /**
  133.      * @return Collection|WebEngineSection[]
  134.      */
  135.     public function getSections() : Collection
  136.     {
  137.         return $this->sections;
  138.     }
  139.     public function addSection(WebEngineSection $section) : self
  140.     {
  141.         if (!$this->sections->contains($section)) {
  142.             $this->sections[] = $section;
  143.             $section->setEngine($this);
  144.         }
  145.         return $this;
  146.     }
  147.     public function removeSection(WebEngineSection $section) : self
  148.     {
  149.         if ($this->sections->contains($section)) {
  150.             $this->sections->removeElement($section);
  151.             // set the owning side to null (unless already changed)
  152.             if ($section->getEngine() === $this) {
  153.                 $section->setEngine(null);
  154.             }
  155.         }
  156.         return $this;
  157.     }
  158.     /**
  159.      * @return Collection|WebList[]
  160.      */
  161.     public function getWebLists() : Collection
  162.     {
  163.         return $this->webLists;
  164.     }
  165.     public function addWebList(WebList $webList) : self
  166.     {
  167.         if (!$this->webLists->contains($webList)) {
  168.             $this->webLists[] = $webList;
  169.             $webList->setWebEngine($this);
  170.         }
  171.         return $this;
  172.     }
  173.     public function removeWebList(WebList $webList) : self
  174.     {
  175.         if ($this->webLists->contains($webList)) {
  176.             $this->webLists->removeElement($webList);
  177.             // set the owning side to null (unless already changed)
  178.             if ($webList->getWebEngine() === $this) {
  179.                 $webList->setWebEngine(null);
  180.             }
  181.         }
  182.         return $this;
  183.     }
  184.     /**
  185.      * @return Collection|Tag[]
  186.      */
  187.     public function getTags() : Collection
  188.     {
  189.         return $this->tags;
  190.     }
  191.     public function addTag(Tag $tag) : self
  192.     {
  193.         if (!$this->tags->contains($tag)) {
  194.             $this->tags[] = $tag;
  195.         }
  196.         return $this;
  197.     }
  198.     public function removeTag(Tag $tag) : self
  199.     {
  200.         if ($this->tags->contains($tag)) {
  201.             $this->tags->removeElement($tag);
  202.         }
  203.         return $this;
  204.     }
  205.     // Getters and setters for useFirstSectionForQuickFilters
  206.     public function getUseFirstSectionForQuickFilters() : ?bool
  207.     {
  208.         return $this->useFirstSectionForQuickFilters;
  209.     }
  210.     public function setUseFirstSectionForQuickFilters(?bool $useFirstSectionForQuickFilters) : self
  211.     {
  212.         $this->useFirstSectionForQuickFilters $useFirstSectionForQuickFilters;
  213.         return $this;
  214.     }
  215. }