vendor/score/cms/src/Entity/Document/DocumentLevel.php line 15

Open in your IDE?
  1. <?php
  2. namespace Score\CmsBundle\Entity\Document;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Score\BaseBundle\Entity\BaseEntity;
  7. /**
  8.  * @ORM\Entity()
  9.  * @ORM\Table(name="cms_document_level")
  10.  * @ORM\HasLifecycleCallbacks()
  11.  */
  12. class DocumentLevel extends BaseEntity
  13. {
  14.     /**
  15.      * @ORM\Column(name="d_name", type="string", length=1000)
  16.      */
  17.     protected $name;
  18.     /**
  19.      * @ORM\Column(name="d_public", type="boolean", nullable=true)
  20.      */
  21.     protected $public;
  22.     /**
  23.      * @ORM\Column(name="d_seo_name", type="string", length=1000, nullable=true)
  24.      */
  25.     protected $seoName;
  26.     /**
  27.      * @ORM\ManyToMany(targetEntity=Document::class, mappedBy="documentLevels")
  28.      */
  29.     protected $documents;
  30.     public function __construct()
  31.     {
  32.         $this->documents = new ArrayCollection();
  33.     }
  34.     
  35.     public function __toString()
  36.     {
  37.         return $this->name;
  38.     }
  39.     public function getName(): ?string
  40.     {
  41.         return $this->name;
  42.     }
  43.     public function setName(string $name): self
  44.     {
  45.         $this->name = $name;
  46.         return $this;
  47.     }
  48.     public function getPublic(): ?bool
  49.     {
  50.         return $this->public;
  51.     }
  52.     public function setPublic(?bool $public): self
  53.     {
  54.         $this->public = $public;
  55.         return $this;
  56.     }
  57.     public function getSeoName(): ?string
  58.     {
  59.         return $this->seoName;
  60.     }
  61.     public function setSeoName(?string $seoName): self
  62.     {
  63.         $this->seoName = $seoName;
  64.         return $this;
  65.     }
  66.     /**
  67.      * @return Collection<int, Document>
  68.      */
  69.     public function getDocuments(): Collection
  70.     {
  71.         return $this->documents;
  72.     }
  73.     public function addDocument(Document $document): self
  74.     {
  75.         if (!$this->documents->contains($document)) {
  76.             $this->documents[] = $document;
  77.         }
  78.         return $this;
  79.     }
  80.     public function removeDocument(Document $document): self
  81.     {
  82.         $this->documents->removeElement($document);
  83.         return $this;
  84.     }
  85. }