src/CasinoBundle/Entity/Alias.php line 37

Open in your IDE?
  1. <?php
  2. namespace App\CasinoBundle\Entity;
  3. use App\CmsBundle\Entity\IdTrait;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * Alias
  7.  *
  8.  * @ORM\Table(
  9.  *     name="alias",
  10.  *     indexes={
  11.  *          @ORM\Index(name="alias_name_index", columns={"name"})
  12.  *     },
  13.  *     uniqueConstraints={
  14.  *         @ORM\UniqueConstraint(name="alias_casino_uindex", columns={"name","casino_id"}),
  15.  *         @ORM\UniqueConstraint(name="alias_software_uindex", columns={"name","software_id"}),
  16.  *         @ORM\UniqueConstraint(name="alias_currency_uindex", columns={"name","currency_id"}),
  17.  *         @ORM\UniqueConstraint(name="alias_payment_method_uindex", columns={"name","payment_method_id"}),
  18.  *         @ORM\UniqueConstraint(name="alias_country_uindex", columns={"name","country_id"}),
  19.  *         @ORM\UniqueConstraint(name="alias_language_uindex", columns={"name","language_id"}),
  20.  *         @ORM\UniqueConstraint(name="alias_slot_uindex", columns={"name","slot_id"}),
  21.  *         @ORM\UniqueConstraint(name="alias_new_bonus_uindex", columns={"name","new_bonus_id"}),
  22.  *         @ORM\UniqueConstraint(name="alias_bonus_type_uindex", columns={"name","bonus_type_id"}),
  23.  *         @ORM\UniqueConstraint(name="alias_bonus_category_uindex", columns={"name","bonus_category_id"}),
  24.  *         @ORM\UniqueConstraint(name="alias_bonus_amount_uindex", columns={"name","bonus_amount_id"}),
  25.  *         @ORM\UniqueConstraint(name="alias_city_uindex", columns={"name","city_id"}),
  26.  *         @ORM\UniqueConstraint(name="alias_state_uindex", columns={"name","state_id"}),
  27.  *         @ORM\UniqueConstraint(name="alias_casino_category_uindex", columns={"name","casino_category_id"}),
  28.  *         @ORM\UniqueConstraint(name="alias_min_deposit_uindex", columns={"name","min_deposit_id"}),
  29.  *         @ORM\UniqueConstraint(name="alias_game_type_uindex", columns={"name","game_type_id"})
  30.  *     }
  31.  * )
  32.  * @ORM\Entity(repositoryClass="App\CasinoBundle\Repository\AliasRepository")
  33.  */
  34. class Alias
  35. {
  36.     use IdTrait;
  37.     use NameTrait;
  38.     private const AVAILABLE_ENTITIES = ['Casino','Software','Currency','PaymentMethod','Country','City','State','Language','Slot','NewBonus','Licence','BonusAmount','BonusCategory','BonusType','CasinoCategory','MinDeposit','GameType'];
  39.     /**
  40.      * @ORM\ManyToOne(targetEntity="App\CasinoBundle\Entity\Casino", inversedBy="aliases", cascade={"persist"})
  41.      * @ORM\JoinColumn(nullable=true)
  42.      */
  43.     public ?Casino $casino;
  44.     /**
  45.      * @ORM\ManyToOne(targetEntity="App\CasinoBundle\Entity\Software", inversedBy="aliases", cascade={"persist"})
  46.      * @ORM\JoinColumn(nullable=true)
  47.      */
  48.     public ?Software $software;
  49.     /**
  50.      * @ORM\ManyToOne(targetEntity="App\CasinoBundle\Entity\Currency", inversedBy="aliases", cascade={"persist"})
  51.      * @ORM\JoinColumn(nullable=true)
  52.      */
  53.     public ?Currency $currency;
  54.     /**
  55.      * @ORM\ManyToOne(targetEntity="App\CasinoBundle\Entity\PaymentMethod", inversedBy="aliases", cascade={"persist"})
  56.      * @ORM\JoinColumn(nullable=true)
  57.      */
  58.     public ?PaymentMethod $paymentMethod;
  59.     /**
  60.      * @ORM\ManyToOne(targetEntity="App\CasinoBundle\Entity\Country", inversedBy="aliases", cascade={"persist"})
  61.      * @ORM\JoinColumn(nullable=true)
  62.      */
  63.     public ?Country $country;
  64.     /**
  65.      * @ORM\ManyToOne(targetEntity="App\CasinoBundle\Entity\City", inversedBy="aliases", cascade={"persist"})
  66.      * @ORM\JoinColumn(nullable=true)
  67.      */
  68.     public ?City $city;
  69.     /**
  70.      * @ORM\ManyToOne(targetEntity="App\CasinoBundle\Entity\State", inversedBy="aliases", cascade={"persist"})
  71.      * @ORM\JoinColumn(nullable=true)
  72.      */
  73.     public ?State $state;
  74.     /**
  75.      * @ORM\ManyToOne(targetEntity="App\CasinoBundle\Entity\Language", inversedBy="aliases", cascade={"persist"})
  76.      * @ORM\JoinColumn(nullable=true)
  77.      */
  78.     public ?Language $language;
  79.     /**
  80.      * @ORM\ManyToOne(targetEntity="App\CasinoBundle\Entity\Slot", inversedBy="aliases", cascade={"persist"})
  81.      * @ORM\JoinColumn(nullable=true)
  82.      */
  83.     public ?Slot $slot;
  84.     /**
  85.      * @ORM\ManyToOne(targetEntity="App\CasinoBundle\Entity\NewBonus", inversedBy="aliases", cascade={"persist"})
  86.      * @ORM\JoinColumn(nullable=true)
  87.      */
  88.     public ?NewBonus $newBonus;
  89.     /**
  90.      * @ORM\ManyToOne(targetEntity="App\CasinoBundle\Entity\Licence", inversedBy="aliases", cascade={"persist"})
  91.      * @ORM\JoinColumn(nullable=true)
  92.      */
  93.     public ?Licence $licence;
  94.     /**
  95.      * @ORM\ManyToOne(targetEntity="App\CasinoBundle\Entity\BonusAmount", inversedBy="aliases", cascade={"persist"})
  96.      * @ORM\JoinColumn(nullable=true)
  97.      */
  98.     public ?BonusAmount $bonusAmount;
  99.     /**
  100.      * @ORM\ManyToOne(targetEntity="App\CasinoBundle\Entity\BonusCategory", inversedBy="aliases", cascade={"persist"})
  101.      * @ORM\JoinColumn(nullable=true)
  102.      */
  103.     public ?BonusCategory $bonusCategory;
  104.     /**
  105.      * @ORM\ManyToOne(targetEntity="App\CasinoBundle\Entity\BonusType", inversedBy="aliases", cascade={"persist"})
  106.      * @ORM\JoinColumn(nullable=true)
  107.      */
  108.     public ?BonusType $bonusType;
  109.     /**
  110.      * @ORM\ManyToOne(targetEntity="App\CasinoBundle\Entity\CasinoCategory", inversedBy="aliases", cascade={"persist"})
  111.      * @ORM\JoinColumn(nullable=true)
  112.      */
  113.     public ?CasinoCategory $casinoCategory;
  114.     /**
  115.      * @ORM\ManyToOne(targetEntity="App\CasinoBundle\Entity\MinDeposit", inversedBy="aliases", cascade={"persist"})
  116.      * @ORM\JoinColumn(nullable=true)
  117.      */
  118.     public ?MinDeposit $minDeposit;
  119.     /**
  120.      * @ORM\ManyToOne(targetEntity="App\CasinoBundle\Entity\GameType", inversedBy="aliases", cascade={"persist"})
  121.      * @ORM\JoinColumn(nullable=true)
  122.      */
  123.     public ?GameType $gameType;
  124.     public function __toString()
  125.     {
  126.         return $this->name;
  127.     }
  128.     public function getType(): ?string
  129.     {
  130.         foreach (self::AVAILABLE_ENTITIES as $entity) {
  131.             $getter 'get'.$entity;
  132.             if ($this->$getter()) return $entity ' - ('.$this->$getter()->getId().') ' $this->$getter()->getName();
  133.         }
  134.         return null;
  135.     }
  136.     public function setCasino(?Casino $casino): self
  137.     {
  138.         $this->casino $casino;
  139.         return $this;
  140.     }
  141.     public function getCasino(): ?Casino
  142.     {
  143.         return $this->casino;
  144.     }
  145.     public function setSoftware(?Software $software): self
  146.     {
  147.         $this->software $software;
  148.         return $this;
  149.     }
  150.     public function getSoftware(): ?Software
  151.     {
  152.         return $this->software;
  153.     }
  154.     public function setCurrency(?Currency $currency): self
  155.     {
  156.         $this->currency $currency;
  157.         return $this;
  158.     }
  159.     public function getCurrency(): ?Currency
  160.     {
  161.         return $this->currency;
  162.     }
  163.     public function setPaymentMethod(?PaymentMethod $paymentMethod): self
  164.     {
  165.         $this->paymentMethod $paymentMethod;
  166.         return $this;
  167.     }
  168.     public function getPaymentMethod(): ?PaymentMethod
  169.     {
  170.         return $this->paymentMethod;
  171.     }
  172.     public function setCountry(?Country $country): self
  173.     {
  174.         $this->country $country;
  175.         return $this;
  176.     }
  177.     public function getCountry(): ?Country
  178.     {
  179.         return $this->country;
  180.     }
  181.     public function setLanguage(?Language $language): self
  182.     {
  183.         $this->language $language;
  184.         return $this;
  185.     }
  186.     public function getLanguage(): ?Language
  187.     {
  188.         return $this->language;
  189.     }
  190.     /**
  191.      * @param NewBonus|null $newBonus
  192.      * @return $this
  193.      */
  194.     public function setNewBonus(?NewBonus $newBonus): self
  195.     {
  196.         $this->newBonus $newBonus;
  197.         return $this;
  198.     }
  199.     /**
  200.      * @return NewBonus|null
  201.      */
  202.     public function getNewBonus(): ?NewBonus
  203.     {
  204.         return $this->newBonus;
  205.     }
  206.     /**
  207.      * @param Slot|null $slot
  208.      * @return $this
  209.      */
  210.     public function setSlot(?Slot $slot): self
  211.     {
  212.         $this->slot $slot;
  213.         return $this;
  214.     }
  215.     /**
  216.      * @return Slot|null
  217.      */
  218.     public function getSlot(): ?Slot
  219.     {
  220.         return $this->slot;
  221.     }
  222.     /**
  223.      * @param Licence|null $licence
  224.      * @return $this
  225.      */
  226.     public function setLicence(?Licence $licence): self
  227.     {
  228.         $this->licence $licence;
  229.         return $this;
  230.     }
  231.     /**
  232.      * @return Licence|null
  233.      */
  234.     public function getLicence(): ?Licence
  235.     {
  236.         return $this->licence;
  237.     }
  238.     /**
  239.      * @param BonusAmount|null $bonusAmount
  240.      * @return $this
  241.      */
  242.     public function setBonusAmount(?BonusAmount $bonusAmount): self
  243.     {
  244.         $this->bonusAmount $bonusAmount;
  245.         return $this;
  246.     }
  247.     /**
  248.      * @return BonusAmount|null
  249.      */
  250.     public function getBonusAmount(): ?BonusAmount
  251.     {
  252.         return $this->bonusAmount;
  253.     }
  254.     /**
  255.      * @param BonusCategory|null $bonusCategory
  256.      * @return $this
  257.      */
  258.     public function setBonusCategory(?BonusCategory $bonusCategory): self
  259.     {
  260.         $this->bonusCategory $bonusCategory;
  261.         return $this;
  262.     }
  263.     /**
  264.      * @return BonusCategory|null
  265.      */
  266.     public function getBonusCategory(): ?BonusCategory
  267.     {
  268.         return $this->bonusCategory;
  269.     }
  270.     /**
  271.      * @param BonusType|null $bonusType
  272.      * @return $this
  273.      */
  274.     public function setBonusType(?BonusType $bonusType): self
  275.     {
  276.         $this->bonusType $bonusType;
  277.         return $this;
  278.     }
  279.     /**
  280.      * @return BonusType|null
  281.      */
  282.     public function getBonusType(): ?BonusType
  283.     {
  284.         return $this->bonusType;
  285.     }
  286.     /**
  287.      * @param City|null $city
  288.      * @return $this
  289.      */
  290.     public function setCity(?City $city): self
  291.     {
  292.         $this->city $city;
  293.         return $this;
  294.     }
  295.     /**
  296.      * @return City|null
  297.      */
  298.     public function getCity(): ?City
  299.     {
  300.         return $this->city;
  301.     }
  302.     /**
  303.      * @param State|null $state
  304.      * @return $this
  305.      */
  306.     public function setState(?State $state): self
  307.     {
  308.         $this->state $state;
  309.         return $this;
  310.     }
  311.     /**
  312.      * @return State|null
  313.      */
  314.     public function getState(): ?State
  315.     {
  316.         return $this->state;
  317.     }
  318.     /**
  319.      * @param CasinoCategory|null $casinoCategory
  320.      * @return $this
  321.      */
  322.     public function setCasinoCategory(?CasinoCategory $casinoCategory): self
  323.     {
  324.         $this->casinoCategory $casinoCategory;
  325.         return $this;
  326.     }
  327.     /**
  328.      * @return CasinoCategory|null
  329.      */
  330.     public function getCasinoCategory(): ?CasinoCategory
  331.     {
  332.         return $this->casinoCategory;
  333.     }
  334.     /**
  335.      * @param MinDeposit|null $minDeposit
  336.      * @return $this
  337.      */
  338.     public function setMinDeposit(?MinDeposit $minDeposit): self
  339.     {
  340.         $this->minDeposit $minDeposit;
  341.         return $this;
  342.     }
  343.     /**
  344.      * @return MinDeposit|null
  345.      */
  346.     public function getMinDeposit(): ?MinDeposit
  347.     {
  348.         return $this->minDeposit;
  349.     }
  350.     /**
  351.      * @return MinDeposit|null
  352.      */
  353.     public function setGameType(?GameType $gameType): self
  354.     {
  355.         $this->gameType $gameType;
  356.         return $this;
  357.     }
  358.     public function getGameType(): ?GameType
  359.     {
  360.         return $this->gameType;
  361.     }
  362. }