src/Entity/Sectors.php line 30

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Traits\LinkTrait;
  4. use App\Entity\Traits\MetaTrait;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use App\Entity\Traits\ActiveTrait;
  7. use App\Entity\Traits\DeleteTrait;
  8. use App\Entity\Traits\SubTitleTrait;
  9. use App\Entity\Traits\SortOrderTrait;
  10. use App\Entity\Traits\TranslateTrait;
  11. use App\Repository\SectorsRepository;
  12. use Gedmo\Mapping\Annotation as Gedmo;
  13. use App\Entity\Traits\ImageUploadTrait;
  14. use App\Entity\Traits\SitemapableTrait;
  15. use App\Entity\Traits\TitleAndContentTrait;
  16. use Doctrine\Common\Collections\Collection;
  17. use App\Entity\Traits\ThirdImageUploadTrait;
  18. use App\Entity\Traits\FourthImageUploadTrait;
  19. use App\Entity\Traits\SecondImageUploadTrait;
  20. use App\Entity\Interfaces\DefaultLinkedEntity;
  21. use Doctrine\Common\Collections\ArrayCollection;
  22. use Gedmo\Timestampable\Traits\TimestampableEntity;
  23. /**
  24.  * @Gedmo\Loggable
  25.  */
  26. #[ORM\Entity(repositoryClassSectorsRepository::class)]
  27. class Sectors implements DefaultLinkedEntity
  28. {
  29.     use TitleAndContentTrait;
  30.     use SubTitleTrait;
  31.     use ImageUploadTrait;
  32.     use SecondImageUploadTrait;
  33.     use ThirdImageUploadTrait;
  34.     use FourthImageUploadTrait;
  35.     use SortOrderTrait;
  36.     use ActiveTrait;
  37.     use DeleteTrait;
  38.     use LinkTrait;
  39.     use MetaTrait;
  40.     use TimestampableEntity;
  41.     use TranslateTrait;
  42.     use SitemapableTrait;
  43.     #[ORM\Id]
  44.     #[ORM\GeneratedValue]
  45.     #[ORM\Column(type:"integer")]
  46.     private $id;
  47.     #[ORM\Column(type'string'length255)]
  48.     private $icon;
  49.     #[ORM\Column(type'text'nullabletrue)]
  50.     private $kicker;
  51.     #[ORM\Column(type'text'nullabletrue)]
  52.     private $content2;
  53.     #[ORM\Column(type'text'nullabletrue)]
  54.     private $content3;
  55.     #[ORM\Column(type'text'nullabletrue)]
  56.     private $content4;
  57.     #[ORM\OneToMany(mappedBy'projectType'targetEntityCaseStudies::class)]
  58.     private $caseStudies;
  59.     #[ORM\ManyToOne(targetEntityGallery::class)]
  60.     private $gallery;
  61.     public function __construct()
  62.     {
  63.         $this->caseStudies = new ArrayCollection();
  64.     }
  65.     public function getId(): ?int
  66.     {
  67.         return $this->id;
  68.     }
  69.     // Required By The MetaTrait / DefaultLinkedEntity Interface
  70.     public function getLinkedPageId(): int
  71.     {
  72.         return 14;
  73.     }
  74.     public function getIcon(): ?string
  75.     {
  76.         return $this->icon;
  77.     }
  78.     public function setIcon(string $icon): self
  79.     {
  80.         $this->icon $icon;
  81.         return $this;
  82.     }
  83.     public function getKicker(): ?string
  84.     {
  85.         return $this->kicker;
  86.     }
  87.     public function setKicker(?string $kicker): self
  88.     {
  89.         $this->kicker $kicker;
  90.         return $this;
  91.     }
  92.     public function getContent2(): ?string
  93.     {
  94.         return $this->content2;
  95.     }
  96.     public function setContent2(?string $content2): self
  97.     {
  98.         $this->content2 $content2;
  99.         return $this;
  100.     }
  101.     public function getContent3(): ?string
  102.     {
  103.         return $this->content3;
  104.     }
  105.     public function setContent3(?string $content3): self
  106.     {
  107.         $this->content3 $content3;
  108.         return $this;
  109.     }
  110.     public function getContent4(): ?string
  111.     {
  112.         return $this->content4;
  113.     }
  114.     public function setContent4(?string $content4): self
  115.     {
  116.         $this->content4 $content4;
  117.         return $this;
  118.     }
  119.     /**
  120.      * @return Collection<int, CaseStudies>
  121.      */
  122.     public function getCaseStudies(): Collection
  123.     {
  124.         return $this->caseStudies;
  125.     }
  126.     public function addCaseStudy(CaseStudies $caseStudy): self
  127.     {
  128.         if (!$this->caseStudies->contains($caseStudy)) {
  129.             $this->caseStudies[] = $caseStudy;
  130.             $caseStudy->setProjectType($this);
  131.         }
  132.         return $this;
  133.     }
  134.     public function removeCaseStudy(CaseStudies $caseStudy): self
  135.     {
  136.         if ($this->caseStudies->removeElement($caseStudy)) {
  137.             // set the owning side to null (unless already changed)
  138.             if ($caseStudy->getProjectType() === $this) {
  139.                 $caseStudy->setProjectType(null);
  140.             }
  141.         }
  142.         return $this;
  143.     }
  144.     public function getGallery(): ?Gallery
  145.     {
  146.         return $this->gallery;
  147.     }
  148.     public function setGallery(?Gallery $gallery): self
  149.     {
  150.         $this->gallery $gallery;
  151.         return $this;
  152.     }
  153.     public function getSitemapRouteParams(): array
  154.     {
  155.         return ['slug' => $this->getSlug()];
  156.     }
  157.     public function isIncludedInSitemap(): bool
  158.     {
  159.         return $this->isActive() &&
  160.             ! $this->isDeleted();
  161.     }
  162. }