src/Entity/Organisation/Type.php line 14

  1. <?php
  2. namespace App\Entity\Organisation;
  3. use App\Entity\Traits\DeletedTrait;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Table(name'organisation_type')]
  8. #[ORM\Index(name'idx_active'columns: ['is_active''deleted'])]
  9. #[ORM\Entity(repositoryClass'App\Repository\Organisation\TypeRepository')]
  10. class Type
  11. {
  12.     use DeletedTrait;
  13.     /**
  14.      * @var int
  15.      */
  16.     #[ORM\Id]
  17.     #[ORM\GeneratedValue(strategy'AUTO')]
  18.     #[ORM\Column(type'integer')]
  19.     private $id;
  20.     /**
  21.      * @var string
  22.      */
  23.     #[ORM\Column(type'string')]
  24.     private $slug;
  25.     /**
  26.      * @var string
  27.      */
  28.     #[ORM\Column(type'string')]
  29.     private $caption;
  30.     /**
  31.      * @var boolean
  32.      */
  33.     #[ORM\Column(type'boolean'name'is_active')]
  34.     private $active true;
  35.     /**
  36.      * @var Collection
  37.      */
  38.     #[ORM\OneToMany(targetEntity'App\Entity\Organisation\Organisation'mappedBy'type')]
  39.     private $organisations;
  40.     /**
  41.      * @var Collection
  42.      */
  43.     #[ORM\OneToMany(targetEntity'App\Entity\Organisation\PageType'mappedBy'type')]
  44.     private $page_types;
  45.     public function __construct()
  46.     {
  47.         $this->organisations=new ArrayCollection();
  48.     }
  49.     /**
  50.      * @return int
  51.      */
  52.     public function getId(): ?int
  53.     {
  54.         return $this->id;
  55.     }
  56.     /**
  57.      * @param int $id
  58.      */
  59.     public function setId(int $id): void
  60.     {
  61.         $this->id $id;
  62.     }
  63.     /**
  64.      * @return string
  65.      */
  66.     public function getSlug(): ?string
  67.     {
  68.         return $this->slug;
  69.     }
  70.     /**
  71.      * @param string $slug
  72.      */
  73.     public function setSlug(string $slug): void
  74.     {
  75.         $this->slug $slug;
  76.     }
  77.     /**
  78.      * @return string
  79.      */
  80.     public function getCaption(): ?string
  81.     {
  82.         return $this->caption;
  83.     }
  84.     /**
  85.      * @param string $caption
  86.      */
  87.     public function setCaption(string $caption): void
  88.     {
  89.         $this->caption $caption;
  90.     }
  91.     /**
  92.      * @return bool
  93.      */
  94.     public function isActive(): bool
  95.     {
  96.         return $this->active;
  97.     }
  98.     /**
  99.      * @param bool $active
  100.      */
  101.     public function setActive(bool $active): void
  102.     {
  103.         $this->active $active;
  104.     }
  105.     /**
  106.      * @return Collection
  107.      */
  108.     public function getOrganisations(): Collection
  109.     {
  110.         return $this->organisations;
  111.     }
  112.     /**
  113.      * @param Collection $organisations
  114.      */
  115.     public function setOrganisations(Collection $organisations): void
  116.     {
  117.         $this->organisations $organisations;
  118.     }
  119.     /**
  120.      * @return Collection
  121.      */
  122.     public function getPageTypes(): Collection
  123.     {
  124.         return $this->page_types;
  125.     }
  126.     /**
  127.      * @param Collection $page_types
  128.      */
  129.     public function setPageTypes(Collection $page_types): void
  130.     {
  131.         $this->page_types $page_types;
  132.     }
  133. }