src/CasinoBundle/Entity/SupervisoryAuthority.php line 18

Open in your IDE?
  1. <?php
  2. namespace App\CasinoBundle\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * SupervisoryAuthority
  8.  *
  9.  * @ORM\Table(name="supervisory_authority",
  10.  *     uniqueConstraints={
  11.  *          @ORM\UniqueConstraint(name="supervisory_authority_name_uindex", columns={"name"})
  12.  *     }
  13.  * )
  14.  * @ORM\Entity(repositoryClass="App\CasinoBundle\Repository\SupervisoryAuthorityRepository")
  15.  */
  16. class SupervisoryAuthority
  17. {
  18.     /**
  19.      * @var int
  20.      *
  21.      * @ORM\Column(name="id", type="integer", nullable=false)
  22.      * @ORM\Id
  23.      * @ORM\GeneratedValue(strategy="IDENTITY")
  24.      */
  25.     private $id;
  26.     /**
  27.      * @var string
  28.      *
  29.      * @ORM\Column(name="name", type="string", length=255, nullable=false)
  30.      */
  31.     private $name;
  32.     /**
  33.      * @var string
  34.      *
  35.      * @ORM\Column(name="website", type="string", length=255, nullable=true)
  36.      */
  37.     private $website;
  38.     /**
  39.      * @var string
  40.      *
  41.      * @ORM\Column(name="logo", type="string", length=255, nullable=true)
  42.      */
  43.     private $logo;
  44.     /**
  45.      * @ORM\ManyToMany(targetEntity="App\CasinoBundle\Entity\Casino", mappedBy="supervisoryAuthorities")
  46.      */
  47.     private $casinos;
  48.     public function __construct()
  49.     {
  50.         $this->casinos = new ArrayCollection();
  51.     }
  52.     public function __toString(): string
  53.     {
  54.         return $this->name;
  55.     }
  56.     /**
  57.      * @return int
  58.      */
  59.     public function getId(): int
  60.     {
  61.         return $this->id;
  62.     }
  63.     /**
  64.      * @param int $id
  65.      */
  66.     public function setId(int $id): void
  67.     {
  68.         $this->id $id;
  69.     }
  70.     /**
  71.      * @return string
  72.      */
  73.     public function getName(): ?string
  74.     {
  75.         return $this->name;
  76.     }
  77.     /**
  78.      * @param string $name
  79.      */
  80.     public function setName(string $name): void
  81.     {
  82.         $this->name $name;
  83.     }
  84.     /**
  85.      * @return string
  86.      */
  87.     public function getWebsite(): ?string
  88.     {
  89.         return $this->website;
  90.     }
  91.     /**
  92.      * @param string $website
  93.      */
  94.     public function setWebsite(string $website): void
  95.     {
  96.         $this->website $website;
  97.     }
  98.     /**
  99.      * @return string
  100.      */
  101.     public function getLogo(): ?string
  102.     {
  103.         return $this->logo;
  104.     }
  105.     /**
  106.      * @param string $logo
  107.      */
  108.     public function setLogo(string $logo): void
  109.     {
  110.         $this->logo $logo;
  111.     }
  112.     /**
  113.      * @return Collection|Casino[]
  114.      */
  115.     public function getCasinos(): Collection
  116.     {
  117.         return $this->casinos;
  118.     }
  119.     public function addCasino(Casino $casino): self
  120.     {
  121.         if (!$this->casinos->contains($casino)) {
  122.             $this->casinos[] = $casino;
  123.             $casino->addSupervisoryAuthority($this);
  124.         }
  125.         return $this;
  126.     }
  127.     public function removeCasino(Casino $casino): self
  128.     {
  129.         if ($this->casinos->contains($casino)) {
  130.             $this->casinos->removeElement($casino);
  131.             $casino->removeSupervisoryAuthority($this);
  132.         }
  133.         return $this;
  134.     }
  135. }