src/Entity/Club.php line 19

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ClubRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=ClubRepository::class)
  9.  * @ORM\Table(name="clubs", indexes={
  10.  *     @ORM\Index(name="idx_allow_in_export", columns={"allow_in_export"}),
  11.  *     @ORM\Index(name="idx_allow_pay_borlette", columns={"allow_pay_borlette"}),
  12.  *     @ORM\Index(name="idx_is_test", columns={"is_test"}),
  13.  *     @ORM\Index(name="idx_is_deleted", columns={"is_deleted"})
  14.  *     })
  15.  */
  16. class Club
  17. {
  18.     /**
  19.      * @ORM\Id()
  20.      * @ORM\GeneratedValue()
  21.      * @ORM\Column(type="integer", options={"unsigned": true})
  22.      */
  23.     private ?int $id null;
  24.     /**
  25.      * @ORM\Column(type="string", length=255, options={"default": ""})
  26.      */
  27.     private string $title "";
  28.     /**
  29.      * @ORM\Column(type="bigint", options={"default": 5000})
  30.      */
  31.     private int $min_bet 5000;
  32.     /**
  33.      * @ORM\Column(type="integer", options={"default": 500000})
  34.      */
  35.     private int $max_bet 500000;
  36.     /**
  37.      * @ORM\Column(type="integer", options={"default": 0, "unsigned": true})
  38.      */
  39.     private int $percent 0;
  40.     /**
  41.      * @ORM\Column(type="bigint", options={"default": 0, "unsigned": true})
  42.      */
  43.     private int $total_in 0;
  44.     /**
  45.      * @ORM\Column(type="bigint", options={"default": 0, "unsigned": true})
  46.      */
  47.     private int $total_out 0;
  48.     /**
  49.      * @ORM\Column(type="string", length=255, options={"default": ""})
  50.      */
  51.     private string $currency "";
  52.     /**
  53.      * @ORM\Column(type="boolean", options={"default": false})
  54.      */
  55.     private bool $is_deleted false;
  56.     /**
  57.      * @ORM\ManyToMany(targetEntity=User::class, mappedBy="clubs")
  58.      */
  59.     private Collection $users;
  60.     /**
  61.      * @ORM\OneToMany(targetEntity=Cashdesk::class, mappedBy="club")
  62.      */
  63.     private Collection $cashdesks;
  64.     /**
  65.      * @ORM\OneToMany(targetEntity=Payment::class, mappedBy="club")
  66.      */
  67.     private Collection $payments;
  68.     /**
  69.      * @ORM\Column(type="text", nullable=true, options={"default": ""})
  70.      */
  71.     private ?string $address "";
  72.     /**
  73.      * @ORM\Column(type="text", nullable=true, options={"default": ""})
  74.      */
  75.     private ?string $responsible "";
  76.     /**
  77.      * @ORM\Column(type="text", nullable=true, options={"default": ""})
  78.      */
  79.     private ?string $rent_currency "";
  80.     /**
  81.      * @ORM\Column(type="boolean", nullable=true, options={"unsigned": true, "default": 0})
  82.      */
  83.     private ?bool $allow_in_export false;
  84.     /**
  85.      * @ORM\Column(type="boolean", nullable=true, options={"unsigned": true, "default": 0})
  86.      */
  87.     private ?bool $logo_disabled false;
  88.     /**
  89.      * @ORM\Column(type="boolean", nullable=true, options={"unsigned": true, "default": 0})
  90.      */
  91.     private ?bool $is_test false;
  92.     /**
  93.      * @ORM\Column(type="boolean", nullable=true, options={"unsigned": true, "default": 0})
  94.      */
  95.     private ?bool $allow_pay_borlette false;
  96.     /**
  97.      * @ORM\Column(type="integer", nullable=false, options={"unsigned": true, "default": 86})
  98.      */
  99.     private int $low_percent 86;
  100.     /**
  101.      * @ORM\Column(type="integer", nullable=false, options={"unsigned": true, "default": 90})
  102.      */
  103.     private int $high_percent 90;
  104.     /**
  105.      * @ORM\Column(type="boolean", nullable=false, options={"default": 0})
  106.      */
  107.     private bool $club_percent_priority false;
  108.     /**
  109.      * @ORM\ManyToOne(targetEntity=ChainClub::class, inversedBy="clubs")
  110.      */
  111.     private ?ChainClub $chain;
  112.     /**
  113.      * @ORM\ManyToOne(targetEntity=RegionClub::class, inversedBy="clubs")
  114.      */
  115.     private ?RegionClub $region;
  116.     /**
  117.      * @ORM\OneToMany(targetEntity=Jackpot::class, mappedBy="club", orphanRemoval=true)
  118.      */
  119.     private Collection $jackpots;
  120.     /**
  121.      * @ORM\Column(type="integer", options={"unsigned": true, "default": 0})
  122.      */
  123.     private int $affiliate_id 0;
  124.     /**
  125.      * @ORM\Column(type="integer", options={"unsigned": true, "default": 0})
  126.      */
  127.     private int $rent 0;
  128.     /**
  129.      * @ORM\Column(type="integer", options={"unsigned": true, "default": 0})
  130.      */
  131.     private int $partner_percent 0;
  132.     /**
  133.      * @ORM\Column(type="integer", options={"default": 0})
  134.      */
  135.     private int $withdrawal_limit_min 0;
  136.     /**
  137.      * @ORM\Column(type="integer", options={"default": 0})
  138.      */
  139.     private int $withdrawal_limit 0;
  140.     /**
  141.      * @ORM\Column(type="string", length=64, options={"default": ""})
  142.      */
  143.     private string $lat "";
  144.     /**
  145.      * @ORM\Column(type="string", length=64, options={"default": ""})
  146.      */
  147.     private string $lon "";
  148.     /**
  149.      * @ORM\Column(type="text", nullable=true, options={"default": ""})
  150.      */
  151.     private ?string $rent_date "";
  152.     /**
  153.      * @ORM\Column(type="text", nullable=true, options={"default": ""})
  154.      */
  155.     public function __construct()
  156.     {
  157.         $this->users = new ArrayCollection();
  158.         $this->cashdesks = new ArrayCollection();
  159.         $this->payments = new ArrayCollection();
  160.         $this->jackpots = new ArrayCollection();
  161.     }
  162.     public function isJackpotEnabled(): bool
  163.     {
  164.         return
  165.             !$this->getJackpots()->isEmpty()
  166.                 && $this->getJackpots()->containsKey(0)
  167.                 && $this->getJackpots()->containsKey(1)
  168.                 && $this->getJackpots()->containsKey(2)
  169.                 && $this->getJackpots()->get(0)->isEnabled()
  170.                 && $this->getJackpots()->get(1)->isEnabled()
  171.                 && $this->getJackpots()->get(2)->isEnabled();
  172.     }
  173.     public function getId(): ?int
  174.     {
  175.         return $this->id;
  176.     }
  177.     public function getTitle(): ?string
  178.     {
  179.         return $this->title;
  180.     }
  181.     public function setTitle(string $title): self
  182.     {
  183.         $this->title $title;
  184.         return $this;
  185.     }
  186.     public function getMinBet(): ?int
  187.     {
  188.         return $this->min_bet;
  189.     }
  190.     public function setMinBet(int $min_bet): self
  191.     {
  192.         $this->min_bet $min_bet;
  193.         return $this;
  194.     }
  195.     public function getPercent(): ?int
  196.     {
  197.         return $this->percent;
  198.     }
  199.     public function setPercent(int $percent): self
  200.     {
  201.         $this->percent $percent;
  202.         return $this;
  203.     }
  204.     public function getTotalIn(): ?int
  205.     {
  206.         return $this->total_in;
  207.     }
  208.     public function setTotalIn(int $total_in): self
  209.     {
  210.         $this->total_in $total_in;
  211.         return $this;
  212.     }
  213.     public function getTotalOut(): ?int
  214.     {
  215.         return $this->total_out;
  216.     }
  217.     public function setTotalOut(int $total_out): self
  218.     {
  219.         $this->total_out $total_out;
  220.         return $this;
  221.     }
  222.     public function getCurrency(): ?string
  223.     {
  224.         return $this->currency;
  225.     }
  226.     public function setCurrency(string $currency): self
  227.     {
  228.         $this->currency $currency;
  229.         return $this;
  230.     }
  231.     public function getIsDeleted(): ?bool
  232.     {
  233.         return $this->is_deleted;
  234.     }
  235.     public function setIsDeleted(bool $is_deleted): self
  236.     {
  237.         $this->is_deleted $is_deleted;
  238.         return $this;
  239.     }
  240.     /**
  241.      * @return Collection
  242.      */
  243.     public function getUsers(): Collection
  244.     {
  245.         return $this->users;
  246.     }
  247.     public function addUser(User $user): self
  248.     {
  249.         if (!$this->users->contains($user)) {
  250.             $this->users[] = $user;
  251.             $user->addClub($this);
  252.         }
  253.         return $this;
  254.     }
  255.     public function removeUser(User $user): self
  256.     {
  257.         if ($this->users->contains($user)) {
  258.             $this->users->removeElement($user);
  259.             $user->removeClub($this);
  260.         }
  261.         return $this;
  262.     }
  263.     /**
  264.      * @return Collection
  265.      */
  266.     public function getCashdesks(): Collection
  267.     {
  268.         return $this->cashdesks;
  269.     }
  270.     public function addCashdesk(Cashdesk $cashdesk): self
  271.     {
  272.         if (!$this->cashdesks->contains($cashdesk)) {
  273.             $this->cashdesks[] = $cashdesk;
  274.             $cashdesk->setClub($this);
  275.         }
  276.         return $this;
  277.     }
  278.     public function removeCashdesk(Cashdesk $cashdesk): self
  279.     {
  280.         if ($this->cashdesks->contains($cashdesk)) {
  281.             $this->cashdesks->removeElement($cashdesk);
  282.             // set the owning side to null (unless already changed)
  283.             if ($cashdesk->getClub() === $this) {
  284.                 $cashdesk->setClub(null);
  285.             }
  286.         }
  287.         return $this;
  288.     }
  289.     /**
  290.      * @return Collection
  291.      */
  292.     public function getPayments(): Collection
  293.     {
  294.         return $this->payments;
  295.     }
  296.     public function addPayment(Payment $payment): self
  297.     {
  298.         if (!$this->payments->contains($payment)) {
  299.             $this->payments[] = $payment;
  300.             $payment->setClub($this);
  301.         }
  302.         return $this;
  303.     }
  304.     public function removePayment(Payment $payment): self
  305.     {
  306.         if ($this->payments->contains($payment)) {
  307.             $this->payments->removeElement($payment);
  308.             // set the owning side to null (unless already changed)
  309.             if ($payment->getClub() === $this) {
  310.                 $payment->setClub(null);
  311.             }
  312.         }
  313.         return $this;
  314.     }
  315.     public function getAddress(): ?string
  316.     {
  317.         return $this->address;
  318.     }
  319.     public function setAddress(?string $address): self
  320.     {
  321.         $this->address $address;
  322.         return $this;
  323.     }
  324.     public function getAllowInExport(): ?bool
  325.     {
  326.         return $this->allow_in_export;
  327.     }
  328.     public function setAllowInExport(?bool $allow_in_export): self
  329.     {
  330.         $this->allow_in_export $allow_in_export;
  331.         return $this;
  332.     }
  333.     public function getLogoDisabled(): ?bool
  334.     {
  335.         return $this->logo_disabled;
  336.     }
  337.     public function setLogoDisabled(?bool $logo_disabled): self
  338.     {
  339.         $this->logo_disabled $logo_disabled;
  340.         return $this;
  341.     }
  342.     public function getIsTest(): ?bool
  343.     {
  344.         return $this->is_test;
  345.     }
  346.     public function setIsTest(?bool $is_test): self
  347.     {
  348.         $this->is_test $is_test;
  349.         return $this;
  350.     }
  351.     public function getAllowPayBorlette(): ?bool
  352.     {
  353.         return $this->allow_pay_borlette;
  354.     }
  355.     public function setAllowPayBorlette(?bool $allow_pay_borlette): self
  356.     {
  357.         $this->allow_pay_borlette $allow_pay_borlette;
  358.         return $this;
  359.     }
  360.     public function getLowPercent(): ?int
  361.     {
  362.         return $this->low_percent;
  363.     }
  364.     public function setLowPercent(int $low_percent): self
  365.     {
  366.         $this->low_percent $low_percent;
  367.         return $this;
  368.     }
  369.     public function getHighPercent(): ?int
  370.     {
  371.         return $this->high_percent;
  372.     }
  373.     public function setHighPercent(int $high_percent): self
  374.     {
  375.         $this->high_percent $high_percent;
  376.         return $this;
  377.     }
  378.     public function isClubPercentPriority(): bool
  379.     {
  380.         return $this->club_percent_priority;
  381.     }
  382.     public function setClubPercentPriority(bool $club_percent_priority): self
  383.     {
  384.         $this->club_percent_priority $club_percent_priority;
  385.         return $this;
  386.     }
  387.     public function getChain(): ?ChainClub
  388.     {
  389.         return $this->chain;
  390.     }
  391.     public function setChain(?ChainClub $chain): self
  392.     {
  393.         $this->chain $chain;
  394.         return $this;
  395.     }
  396.     public function getRegion(): ?RegionClub
  397.     {
  398.         return $this->region;
  399.     }
  400.     public function setRegion(?RegionClub $region): self
  401.     {
  402.         $this->region $region;
  403.         return $this;
  404.     }
  405.     public function getMaxBet(): ?int
  406.     {
  407.         return $this->max_bet;
  408.     }
  409.     public function setMaxBet(int $max_bet): self
  410.     {
  411.         $this->max_bet $max_bet;
  412.         return $this;
  413.     }
  414.     /**
  415.      * @return Collection
  416.      */
  417.     public function getJackpots(): Collection
  418.     {
  419.         return $this->jackpots;
  420.     }
  421.     public function addJackpot(Jackpot $jackpot): self
  422.     {
  423.         if (!$this->jackpots->contains($jackpot)) {
  424.             $this->jackpots[] = $jackpot;
  425.             $jackpot->setClub($this);
  426.         }
  427.         return $this;
  428.     }
  429.     public function getAffiliateId(): int
  430.     {
  431.         return $this->affiliate_id;
  432.     }
  433.     public function setAffiliateId(int $affiliate_id): self
  434.     {
  435.         $this->affiliate_id $affiliate_id;
  436.         return $this;
  437.     }
  438.     public function getRent(): ?int
  439.     {
  440.         return $this->rent;
  441.     }
  442.     public function setRent(int $rent): self
  443.     {
  444.         $this->rent $rent;
  445.         return $this;
  446.     }
  447.     public function getRentDate(): ?string
  448.     {
  449.         return $this->rent_date;
  450.     }
  451.     public function setRentDate(?string $rent_date): self
  452.     {
  453.         $this->rent_date $rent_date;
  454.         return $this;
  455.     }
  456.     public function getPartnerPercent(): ?int
  457.     {
  458.         return $this->partner_percent;
  459.     }
  460.     public function setPartnerPercent(int $partner_percent): self
  461.     {
  462.         $this->partner_percent $partner_percent;
  463.         return $this;
  464.     }
  465.     public function getWithdrawalLimitMin(): ?int
  466.     {
  467.         return $this->withdrawal_limit_min;
  468.     }
  469.     public function setWithdrawalLimitMin(int $withdrawal_limit_min): self
  470.     {
  471.         $this->withdrawal_limit_min $withdrawal_limit_min;
  472.         return $this;
  473.     }
  474.     public function getWithdrawalLimit(): ?int
  475.     {
  476.         return $this->withdrawal_limit;
  477.     }
  478.     public function setWithdrawalLimit(int $withdrawal_limit): self
  479.     {
  480.         $this->withdrawal_limit $withdrawal_limit;
  481.         return $this;
  482.     }
  483.     public function getLat(): ?string
  484.     {
  485.         return $this->lat;
  486.     }
  487.     public function setLat(string $lat): self
  488.     {
  489.         $this->lat $lat;
  490.         return $this;
  491.     }
  492.     public function getLon(): ?string
  493.     {
  494.         return $this->lon;
  495.     }
  496.     public function setLon(string $lon): self
  497.     {
  498.         $this->lon $lon;
  499.         return $this;
  500.     }
  501.     public function getResponsible(): ?string
  502.     {
  503.         return $this->responsible;
  504.     }
  505.     public function setResponsible(?string $responsible): self
  506.     {
  507.         $this->responsible $responsible;
  508.         return $this;
  509.     }
  510.     public function getRentCurrency(): ?string
  511.     {
  512.         return $this->rent_currency;
  513.     }
  514.     public function setRentCurrency(?string $rent_currency): self
  515.     {
  516.         $this->rent_currency $rent_currency;
  517.         return $this;
  518.     }
  519. }