<?php
namespace App\Entity;
use App\Repository\ClubRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=ClubRepository::class)
* @ORM\Table(name="clubs", indexes={
* @ORM\Index(name="idx_allow_in_export", columns={"allow_in_export"}),
* @ORM\Index(name="idx_allow_pay_borlette", columns={"allow_pay_borlette"}),
* @ORM\Index(name="idx_is_test", columns={"is_test"}),
* @ORM\Index(name="idx_is_deleted", columns={"is_deleted"})
* })
*/
class Club
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer", options={"unsigned": true})
*/
private ?int $id = null;
/**
* @ORM\Column(type="string", length=255, options={"default": ""})
*/
private string $title = "";
/**
* @ORM\Column(type="bigint", options={"default": 5000})
*/
private int $min_bet = 5000;
/**
* @ORM\Column(type="integer", options={"default": 500000})
*/
private int $max_bet = 500000;
/**
* @ORM\Column(type="integer", options={"default": 0, "unsigned": true})
*/
private int $percent = 0;
/**
* @ORM\Column(type="bigint", options={"default": 0, "unsigned": true})
*/
private int $total_in = 0;
/**
* @ORM\Column(type="bigint", options={"default": 0, "unsigned": true})
*/
private int $total_out = 0;
/**
* @ORM\Column(type="string", length=255, options={"default": ""})
*/
private string $currency = "";
/**
* @ORM\Column(type="boolean", options={"default": false})
*/
private bool $is_deleted = false;
/**
* @ORM\ManyToMany(targetEntity=User::class, mappedBy="clubs")
*/
private Collection $users;
/**
* @ORM\OneToMany(targetEntity=Cashdesk::class, mappedBy="club")
*/
private Collection $cashdesks;
/**
* @ORM\OneToMany(targetEntity=Payment::class, mappedBy="club")
*/
private Collection $payments;
/**
* @ORM\Column(type="text", nullable=true, options={"default": ""})
*/
private ?string $address = "";
/**
* @ORM\Column(type="text", nullable=true, options={"default": ""})
*/
private ?string $responsible = "";
/**
* @ORM\Column(type="text", nullable=true, options={"default": ""})
*/
private ?string $rent_currency = "";
/**
* @ORM\Column(type="boolean", nullable=true, options={"unsigned": true, "default": 0})
*/
private ?bool $allow_in_export = false;
/**
* @ORM\Column(type="boolean", nullable=true, options={"unsigned": true, "default": 0})
*/
private ?bool $logo_disabled = false;
/**
* @ORM\Column(type="boolean", nullable=true, options={"unsigned": true, "default": 0})
*/
private ?bool $is_test = false;
/**
* @ORM\Column(type="boolean", nullable=true, options={"unsigned": true, "default": 0})
*/
private ?bool $allow_pay_borlette = false;
/**
* @ORM\Column(type="integer", nullable=false, options={"unsigned": true, "default": 86})
*/
private int $low_percent = 86;
/**
* @ORM\Column(type="integer", nullable=false, options={"unsigned": true, "default": 90})
*/
private int $high_percent = 90;
/**
* @ORM\Column(type="boolean", nullable=false, options={"default": 0})
*/
private bool $club_percent_priority = false;
/**
* @ORM\ManyToOne(targetEntity=ChainClub::class, inversedBy="clubs")
*/
private ?ChainClub $chain;
/**
* @ORM\ManyToOne(targetEntity=RegionClub::class, inversedBy="clubs")
*/
private ?RegionClub $region;
/**
* @ORM\OneToMany(targetEntity=Jackpot::class, mappedBy="club", orphanRemoval=true)
*/
private Collection $jackpots;
/**
* @ORM\Column(type="integer", options={"unsigned": true, "default": 0})
*/
private int $affiliate_id = 0;
/**
* @ORM\Column(type="integer", options={"unsigned": true, "default": 0})
*/
private int $rent = 0;
/**
* @ORM\Column(type="integer", options={"unsigned": true, "default": 0})
*/
private int $partner_percent = 0;
/**
* @ORM\Column(type="integer", options={"default": 0})
*/
private int $withdrawal_limit_min = 0;
/**
* @ORM\Column(type="integer", options={"default": 0})
*/
private int $withdrawal_limit = 0;
/**
* @ORM\Column(type="string", length=64, options={"default": ""})
*/
private string $lat = "";
/**
* @ORM\Column(type="string", length=64, options={"default": ""})
*/
private string $lon = "";
/**
* @ORM\Column(type="text", nullable=true, options={"default": ""})
*/
private ?string $rent_date = "";
/**
* @ORM\Column(type="text", nullable=true, options={"default": ""})
*/
public function __construct()
{
$this->users = new ArrayCollection();
$this->cashdesks = new ArrayCollection();
$this->payments = new ArrayCollection();
$this->jackpots = new ArrayCollection();
}
public function isJackpotEnabled(): bool
{
return
!$this->getJackpots()->isEmpty()
&& $this->getJackpots()->containsKey(0)
&& $this->getJackpots()->containsKey(1)
&& $this->getJackpots()->containsKey(2)
&& $this->getJackpots()->get(0)->isEnabled()
&& $this->getJackpots()->get(1)->isEnabled()
&& $this->getJackpots()->get(2)->isEnabled();
}
public function getId(): ?int
{
return $this->id;
}
public function getTitle(): ?string
{
return $this->title;
}
public function setTitle(string $title): self
{
$this->title = $title;
return $this;
}
public function getMinBet(): ?int
{
return $this->min_bet;
}
public function setMinBet(int $min_bet): self
{
$this->min_bet = $min_bet;
return $this;
}
public function getPercent(): ?int
{
return $this->percent;
}
public function setPercent(int $percent): self
{
$this->percent = $percent;
return $this;
}
public function getTotalIn(): ?int
{
return $this->total_in;
}
public function setTotalIn(int $total_in): self
{
$this->total_in = $total_in;
return $this;
}
public function getTotalOut(): ?int
{
return $this->total_out;
}
public function setTotalOut(int $total_out): self
{
$this->total_out = $total_out;
return $this;
}
public function getCurrency(): ?string
{
return $this->currency;
}
public function setCurrency(string $currency): self
{
$this->currency = $currency;
return $this;
}
public function getIsDeleted(): ?bool
{
return $this->is_deleted;
}
public function setIsDeleted(bool $is_deleted): self
{
$this->is_deleted = $is_deleted;
return $this;
}
/**
* @return Collection
*/
public function getUsers(): Collection
{
return $this->users;
}
public function addUser(User $user): self
{
if (!$this->users->contains($user)) {
$this->users[] = $user;
$user->addClub($this);
}
return $this;
}
public function removeUser(User $user): self
{
if ($this->users->contains($user)) {
$this->users->removeElement($user);
$user->removeClub($this);
}
return $this;
}
/**
* @return Collection
*/
public function getCashdesks(): Collection
{
return $this->cashdesks;
}
public function addCashdesk(Cashdesk $cashdesk): self
{
if (!$this->cashdesks->contains($cashdesk)) {
$this->cashdesks[] = $cashdesk;
$cashdesk->setClub($this);
}
return $this;
}
public function removeCashdesk(Cashdesk $cashdesk): self
{
if ($this->cashdesks->contains($cashdesk)) {
$this->cashdesks->removeElement($cashdesk);
// set the owning side to null (unless already changed)
if ($cashdesk->getClub() === $this) {
$cashdesk->setClub(null);
}
}
return $this;
}
/**
* @return Collection
*/
public function getPayments(): Collection
{
return $this->payments;
}
public function addPayment(Payment $payment): self
{
if (!$this->payments->contains($payment)) {
$this->payments[] = $payment;
$payment->setClub($this);
}
return $this;
}
public function removePayment(Payment $payment): self
{
if ($this->payments->contains($payment)) {
$this->payments->removeElement($payment);
// set the owning side to null (unless already changed)
if ($payment->getClub() === $this) {
$payment->setClub(null);
}
}
return $this;
}
public function getAddress(): ?string
{
return $this->address;
}
public function setAddress(?string $address): self
{
$this->address = $address;
return $this;
}
public function getAllowInExport(): ?bool
{
return $this->allow_in_export;
}
public function setAllowInExport(?bool $allow_in_export): self
{
$this->allow_in_export = $allow_in_export;
return $this;
}
public function getLogoDisabled(): ?bool
{
return $this->logo_disabled;
}
public function setLogoDisabled(?bool $logo_disabled): self
{
$this->logo_disabled = $logo_disabled;
return $this;
}
public function getIsTest(): ?bool
{
return $this->is_test;
}
public function setIsTest(?bool $is_test): self
{
$this->is_test = $is_test;
return $this;
}
public function getAllowPayBorlette(): ?bool
{
return $this->allow_pay_borlette;
}
public function setAllowPayBorlette(?bool $allow_pay_borlette): self
{
$this->allow_pay_borlette = $allow_pay_borlette;
return $this;
}
public function getLowPercent(): ?int
{
return $this->low_percent;
}
public function setLowPercent(int $low_percent): self
{
$this->low_percent = $low_percent;
return $this;
}
public function getHighPercent(): ?int
{
return $this->high_percent;
}
public function setHighPercent(int $high_percent): self
{
$this->high_percent = $high_percent;
return $this;
}
public function isClubPercentPriority(): bool
{
return $this->club_percent_priority;
}
public function setClubPercentPriority(bool $club_percent_priority): self
{
$this->club_percent_priority = $club_percent_priority;
return $this;
}
public function getChain(): ?ChainClub
{
return $this->chain;
}
public function setChain(?ChainClub $chain): self
{
$this->chain = $chain;
return $this;
}
public function getRegion(): ?RegionClub
{
return $this->region;
}
public function setRegion(?RegionClub $region): self
{
$this->region = $region;
return $this;
}
public function getMaxBet(): ?int
{
return $this->max_bet;
}
public function setMaxBet(int $max_bet): self
{
$this->max_bet = $max_bet;
return $this;
}
/**
* @return Collection
*/
public function getJackpots(): Collection
{
return $this->jackpots;
}
public function addJackpot(Jackpot $jackpot): self
{
if (!$this->jackpots->contains($jackpot)) {
$this->jackpots[] = $jackpot;
$jackpot->setClub($this);
}
return $this;
}
public function getAffiliateId(): int
{
return $this->affiliate_id;
}
public function setAffiliateId(int $affiliate_id): self
{
$this->affiliate_id = $affiliate_id;
return $this;
}
public function getRent(): ?int
{
return $this->rent;
}
public function setRent(int $rent): self
{
$this->rent = $rent;
return $this;
}
public function getRentDate(): ?string
{
return $this->rent_date;
}
public function setRentDate(?string $rent_date): self
{
$this->rent_date = $rent_date;
return $this;
}
public function getPartnerPercent(): ?int
{
return $this->partner_percent;
}
public function setPartnerPercent(int $partner_percent): self
{
$this->partner_percent = $partner_percent;
return $this;
}
public function getWithdrawalLimitMin(): ?int
{
return $this->withdrawal_limit_min;
}
public function setWithdrawalLimitMin(int $withdrawal_limit_min): self
{
$this->withdrawal_limit_min = $withdrawal_limit_min;
return $this;
}
public function getWithdrawalLimit(): ?int
{
return $this->withdrawal_limit;
}
public function setWithdrawalLimit(int $withdrawal_limit): self
{
$this->withdrawal_limit = $withdrawal_limit;
return $this;
}
public function getLat(): ?string
{
return $this->lat;
}
public function setLat(string $lat): self
{
$this->lat = $lat;
return $this;
}
public function getLon(): ?string
{
return $this->lon;
}
public function setLon(string $lon): self
{
$this->lon = $lon;
return $this;
}
public function getResponsible(): ?string
{
return $this->responsible;
}
public function setResponsible(?string $responsible): self
{
$this->responsible = $responsible;
return $this;
}
public function getRentCurrency(): ?string
{
return $this->rent_currency;
}
public function setRentCurrency(?string $rent_currency): self
{
$this->rent_currency = $rent_currency;
return $this;
}
}