<?php
namespace App\CasinoBundle\Entity;
use App\CasinoBundle\Enum\BonusOfferTypeEnum;
use App\CmsBundle\Entity\LogInterface;
use App\CmsBundle\Entity\LogTrait;
use App\CmsBundle\Entity\PublishedTrait;
use App\CmsBundle\Entity\Site;
use App\CmsBundle\Enum\LogActionEnum;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use App\CmsBundle\Entity\TimeStampedTrait;
use DateTime;
use App\CmsBundle\Entity\IdTrait;
use App\CmsBundle\Entity\TitleTrait;
/**
* NewBonus
*
* @ORM\Table(
* name="new_bonus",
* indexes={
* @ORM\Index(name="new_bonus_title_short_index", columns={"title_short"}),
* @ORM\Index(name="new_bonus_title_index", columns={"title"}),
* @ORM\Index(name="new_bonus_updated_index", columns={"updated"}),
* @ORM\Index(name="new_bonus_amount_max_index", columns={"amount_max"}),
* @ORM\Index(name="new_bonus_free_spins_index", columns={"free_spins"}),
* @ORM\Index(name="new_bonus_percent_index", columns={"percent"}),
* @ORM\Index(name="new_bonus_deposit_min_index", columns={"deposit_min"}),
* @ORM\Index(name="new_bonus_code_index", columns={"code"}),
* @ORM\Index(name="new_bonus_skin_bg_index", columns={"skin_bg"}),
* @ORM\Index(name="new_bonus_skin_character_index", columns={"skin_character"}),
* @ORM\Index(name="new_bonus_published_index", columns={"published"}),
* @ORM\Index(name="new_bonus_clone_index", columns={"clone"}),
* @ORM\Index(name="new_bonus_score_index", columns={"score"}),
* @ORM\Index(name="new_bonus_expired_index", columns={"expired_date"}),
* @ORM\Index(name="new_bonus_start_published_date_index", columns={"start_published_date"}),
* @ORM\Index(name="new_bonus_end_published_date_index", columns={"end_published_date"})
* },
* uniqueConstraints={
* @ORM\UniqueConstraint(name="new_bonus_hash_uindex", columns={"hash"})
* }
* )
* @ORM\Entity(
* repositoryClass="App\CasinoBundle\Repository\NewBonusRepository"
* )
* @ORM\HasLifecycleCallbacks()
* @ORM\Cache(
* usage="NONSTRICT_READ_WRITE",
* region="one_day"
* )
*/
class NewBonus implements LogInterface
{
use IdTrait, TitleTrait, TimeStampedTrait, ScoreTrait, AliasTrait, HashTrait, CacheTrait, PublishedTrait, LogTrait;
/**
* @var string
*
* @ORM\Column(
* name="title_short",
* type="string",
* length=255,
* nullable=true
* )
*/
private $titleShort;
/**
* @ORM\ManyToOne(
* targetEntity="App\CasinoBundle\Entity\Casino",
* inversedBy="newBonuses",
* cascade={"persist"}
* )
* @ORM\JoinColumn(
* nullable=false
* )
*/
private ?Casino $casino;
/**
* @ORM\ManyToMany (
* targetEntity="App\CasinoBundle\Entity\BonusCategory",
* inversedBy="newBonuses",
* cascade={"persist"},
* fetch="EXTRA_LAZY"
* )
* @ORM\JoinTable(
* name="new_bonus_bonus_categories",
* joinColumns={
* @ORM\JoinColumn(name="new_bonus_id", referencedColumnName="id")
* },
* inverseJoinColumns={
* @ORM\JoinColumn(name="bonus_category_id", referencedColumnName="id")
* }
* )
*/
private Collection $bonusCategories;
/**
* @ORM\ManyToMany (
* targetEntity="App\CasinoBundle\Entity\BonusType",
* inversedBy="newBonuses",
* cascade={"persist"},
* fetch="EXTRA_LAZY"
* )
* @ORM\JoinTable(
* name="new_bonus_bonus_type",
* joinColumns={
* @ORM\JoinColumn(name="new_bonus_id", referencedColumnName="id")
* },
* inverseJoinColumns={
* @ORM\JoinColumn(name="bonus_type_id", referencedColumnName="id")
* }
* )
*/
private Collection $bonusTypes;
/**
* @ORM\ManyToMany (
* targetEntity="App\CasinoBundle\Entity\Currency",
* inversedBy="newBonuses",
* cascade={"persist"},
* fetch="EXTRA_LAZY"
* )
* @ORM\JoinTable(
* name="new_bonus_currency",
* joinColumns={
* @ORM\JoinColumn(name="new_bonus_id", referencedColumnName="id")
* },
* inverseJoinColumns={
* @ORM\JoinColumn(name="currency_id", referencedColumnName="id")
* }
* )
*/
private Collection $currencies;
/**
* @ORM\ManyToMany (
* targetEntity="App\CasinoBundle\Entity\Country",
* inversedBy="newBonuses",
* fetch="EXTRA_LAZY"
* )
* @ORM\JoinTable(
* name="new_bonus_country",
* joinColumns={
* @ORM\JoinColumn(name="new_bonus_id", referencedColumnName="id")
* },
* inverseJoinColumns={
* @ORM\JoinColumn(name="country_id", referencedColumnName="id")
* }
* )
*/
private Collection $countries;
/**
* @ORM\ManyToMany (
* targetEntity="App\CasinoBundle\Entity\Slot",
* inversedBy="newBonuses",
* cascade={"persist"}
* )
* @ORM\JoinTable(
* name="new_bonus_slot",
* joinColumns={
* @ORM\JoinColumn(name="new_bonus_id", referencedColumnName="id")
* },
* inverseJoinColumns={
* @ORM\JoinColumn(name="slot_id", referencedColumnName="id")
* }
* )
*/
private Collection $slots;
/**
* @ORM\OneToMany(targetEntity="App\CasinoBundle\Entity\Alias", mappedBy="newBonus", cascade={"persist"}, orphanRemoval=true)
*/
private Collection $aliases;
/**
* @var string|null
*
* @ORM\Column(
* name="code",
* type="string",
* length=255,
* nullable=true
* )
*/
private ?string $code = null;
/**
* @var string|null
*
* @ORM\Column(
* name="skin_bg",
* type="string",
* length=255,
* nullable=true
* )
*/
private ?string $skinBg = null;
/**
* @var string|null
*
* @ORM\Column(
* name="skin_character",
* type="string",
* length=255,
* nullable=true
* )
*/
private ?string $skinCharacter = null;
/**
* @var string|null
*
* @ORM\Column(
* name="original_bonus_url",
* type="string",
* length=255,
* nullable=true
* )
*/
private ?string $originalBonusUrl;
/**
* @var string|null
*
* @ORM\Column(
* name="label",
* type="string",
* length=255,
* nullable=true
* )
*/
private ?string $label = null;
/**
* @ORM\Column(
* name="tnc_content",
* type="text",
* nullable=true
* )
*/
private ?string $tncContent = null;
/**
* @var bool
*
* @ORM\Column(
* name="special_button_title",
* type="boolean",
* nullable=true
* )
*/
private ?bool $specialButtonTitle;
/**
* @var bool
*
* @ORM\Column(
* name="animated_button",
* type="boolean",
* nullable=true
* )
*/
private ?bool $animatedButton;
/**
* @var bool
*
* @ORM\Column(
* name="clone",
* type="boolean",
* nullable=false,
* options={"default":"0"}
* )
*/
private ?bool $clone;
/**
* @var bool
*
* @ORM\Column(
* name="copy_country_from_casino",
* type="boolean",
* nullable=true
* )
*/
private ?bool $copyCountryFromCasino;
/**
* @var bool
*
*/
private bool $removeCountries = false;
/**
* @var bool
*
* @ORM\Column(
* name="add_all_sites",
* type="boolean",
* nullable=true,
* options={"default":"0"}
* )
*/
private ?bool $addAllSites = null;
/**
* @var int|null
*
* @ORM\Column(
* name="deposit_min",
* type="float",
* nullable=true
* )
*/
private ?float $depositMin;
/**
* @var string
*
* @ORM\Column(
* name="wagering_requirements",
* type="string",
* length=255,
* nullable=true
* )
*/
private ?string $wageringRequirements;
/**
* @var float|null
*
* @ORM\Column(
* name="amount_max",
* type="float",
* nullable=true
* )
*/
private ?float $amountMax = null;
/**
* @var integer|null
*
* @ORM\Column(
* name="percent",
* type="integer",
* nullable=true
* )
*/
private ?int $percent = null;
/**
* @var integer|null
*
* @ORM\Column(
* name="free_spins",
* type="integer",
* nullable=true
* )
*/
private ?int $freeSpins = null;
/**
* @var bool|null
*
* @ORM\Column(
* name="cashable",
* type="boolean",
* nullable=true
* )
*/
private ?bool $cashable = null;
/**
* @var DateTime|null
*
* @ORM\Column(
* name="expired_date",
* type="datetime",
* nullable=true
* )
*/
private ?DateTime $expiredDate = null;
/**
* @var DateTime|null
*
* @ORM\Column(
* name="start_published_date",
* type="datetime",
* nullable=true
* )
*/
private ?DateTime $startPublishedDate;
/**
* @var DateTime|null
*
* @ORM\Column(
* name="end_published_date",
* type="datetime",
* nullable=true
* )
*/
private ?DateTime $endPublishedDate;
/**
* @var string|null
*
* @ORM\Column(
* name="terms_url",
* type="string",
* length=255,
* nullable=true
* )
*/
private ?string $termsUrl = null;
/**
* @var string|null
*
* @ORM\Column(
* name="bonus_url",
* type="string",
* length=255,
* nullable=true
* )
*/
private ?string $bonusUrl = null;
/**
* @var string|null
*
* @ORM\Column(name="max_cashout", type="string", length=255, nullable=true)
*/
protected ?string $maxCashout = null;
/**
* @var string|null
*
* @ORM\Column(name="max_bet", type="string", length=255, nullable=true)
*/
protected ?string $maxBet = null;
/**
* @var string|null
*
* @ORM\Column(name="free_spins_conditions", type="string", length=255, nullable=true)
*/
protected ?string $freeSpinsConditions = null;
/**
* @var integer
*
* @ORM\Column(name="expires_after", type="integer", nullable=true)
*/
private $expiresAfter;
/**
* @ORM\Column(type="boolean", nullable=false, options={"default" = false})
*/
private bool $sponsored = false;
/**
* @ORM\OneToMany(
* targetEntity=BonusTag::class,
* mappedBy="newBonus",
* cascade={"persist"},
* orphanRemoval=true
* )
*/
private Collection $bonusTags;
/**
* @var int
*
* @ORM\Column(name="offer_type", type="integer", nullable=false, options={"default" = 0})
*/
private int $offerType = 0;
/**
* @var float
*
* @ORM\Column(name="bonus_generosity", type="float", nullable=false, options={"default" = 0})
*/
private float $bonusGenerosity = 0.0;
/**
* @var float
*
* @ORM\Column(name="summator", type="float", nullable=false, options={"default" = 0})
*/
private float $summator = 0.0;
/**
* @ORM\ManyToMany (
* targetEntity="App\CmsBundle\Entity\Site",
* inversedBy="newBonuses",
* cascade={"persist"},
* )
* @ORM\JoinTable(
* name="new_bonus_site",
* joinColumns={
* @ORM\JoinColumn(name="new_bonus_id", referencedColumnName="id")
* },
* inverseJoinColumns={
* @ORM\JoinColumn(name="site_id", referencedColumnName="id")
* }
* )
*/
private Collection $sites;
/**
* @ORM\OneToMany(
* targetEntity="App\CasinoBundle\Entity\IssueReport",
* mappedBy="newBonus",
* cascade={"persist"},
* orphanRemoval=true
* )
*/
private Collection $issueReports;
/**
* @ORM\OneToMany(
* targetEntity="App\CasinoBundle\Entity\UserBonus",
* mappedBy="bonus",
* cascade={"persist", "remove"}
* )
*/
private Collection $bonusOwners;
/**
* @ORM\OneToMany(
* targetEntity="App\CasinoBundle\Entity\BonusTitle",
* mappedBy="bonus",
* cascade={"persist","remove"},
* orphanRemoval=true
* )
*/
private Collection $titles;
/**
* @var ?int
*
* @ORM\Column(name="price", type="integer", nullable=true)
*/
private ?int $price = null;
/**
* NewBonus constructor.
*/
public function __construct()
{
$this->casino = null;
$this->bonusTypes = new ArrayCollection();
$this->bonusCategories = new ArrayCollection();
$this->sites = new ArrayCollection();
$this->countries = new ArrayCollection();
$this->currencies = new ArrayCollection();
$this->slots = new ArrayCollection();
$this->aliases = new ArrayCollection();
$this->bonusTags = new ArrayCollection();
$this->issueReports = new ArrayCollection();
$this->bonusOwners = new ArrayCollection();
$this->titles = new ArrayCollection();
}
/**
* @return Casino|null
*/
public function getCasino(): ?Casino
{
return $this->casino;
}
/**
* @param Casino $casino
* @return $this
*/
public function setCasino(Casino $casino): self
{
$this->casino = $casino;
return $this;
}
/**
* @return Collection|ArrayCollection|BonusType[]
*/
public function getBonusTypes(): Collection
{
return $this->bonusTypes;
}
/**
* @param BonusType $bonusType
* @return $this
*/
public function addBonusType(BonusType $bonusType): self
{
if (!$this->bonusTypes->contains($bonusType)) {
$this->bonusTypes[] = $bonusType;
$bonusType->addNewBonus($this);
$this->addCollectionLog(LogActionEnum::ADD, 'bonusType', $bonusType);
}
return $this;
}
/**
* @param BonusType $bonusType
* @return $this
*/
public function removeBonusType(BonusType $bonusType): self
{
if ($this->bonusTypes->contains($bonusType)) {
$this->bonusTypes->removeElement($bonusType);
$bonusType->removeNewBonus($this);
$this->addCollectionLog(LogActionEnum::REMOVE, 'bonusType', $bonusType);
}
return $this;
}
/**
* @return Collection|BonusCategory[]
*/
public function getBonusCategories(): Collection
{
return $this->bonusCategories;
}
/**
* @param BonusCategory $bonusCategory
* @return $this
*/
public function addBonusCategory(BonusCategory $bonusCategory): self
{
if (!$this->bonusCategories->contains($bonusCategory)) {
$this->bonusCategories[] = $bonusCategory;
$bonusCategory->addNewBonus($this);
$this->addCollectionLog(LogActionEnum::ADD, 'bonusCategory', $bonusCategory);
}
return $this;
}
/**
* @param BonusCategory $bonusCategory
* @return $this
*/
public function removeBonusCategory(BonusCategory $bonusCategory): self
{
if ($this->bonusCategories->contains($bonusCategory)) {
$this->bonusCategories->removeElement($bonusCategory);
$bonusCategory->removeNewBonus($this);
$this->addCollectionLog(LogActionEnum::REMOVE, 'bonusCategory', $bonusCategory);
}
return $this;
}
/**
* @return Collection|Currency[]
*/
public function getCurrencies(): Collection
{
return $this->currencies;
}
/**
* @param Currency $currency
* @return $this
*/
public function addCurrency(Currency $currency): self
{
if (!$this->currencies->contains($currency)) {
$this->currencies[] = $currency;
$currency->addNewBonus($this);
$this->addCollectionLog(LogActionEnum::ADD, 'currency', $currency);
}
return $this;
}
/**
* @param Currency $currency
* @return $this
*/
public function removeCurrency(Currency $currency): self
{
if ($this->currencies->contains($currency)) {
$this->currencies->removeElement($currency);
$currency->removeNewBonus($this);
$this->addCollectionLog(LogActionEnum::REMOVE, 'currency', $currency);
}
return $this;
}
/**
* @return Collection
*/
public function getSites(): Collection
{
return $this->sites;
}
/**
* @param Site $site
* @return $this
*/
public function addSite(Site $site): self
{
if (!$this->sites->contains($site)) {
$this->sites[] = $site;
$site->addNewBonus($this);
$this->addCollectionLog(LogActionEnum::ADD, 'site', $site);
}
return $this;
}
/**
* @param Site $site
* @return $this
*/
public function removeSite(Site $site): self
{
if ($this->sites->contains($site)) {
$this->sites->removeElement($site);
$site->removeNewBonus($this);
$this->addCollectionLog(LogActionEnum::REMOVE, 'site', $site);
}
return $this;
}
/**
* @return Collection|Country[]
*/
public function getCountries(): Collection
{
return $this->countries;
}
/**
* @param Country $country
* @return $this
*/
public function addCountry(Country $country): self
{
if (!$this->countries->contains($country)) {
$this->countries[] = $country;
$country->addNewBonus($this);
$this->addCollectionLog(LogActionEnum::ADD, 'country', $country);
}
return $this;
}
/**
* @param Country $country
* @return $this
*/
public function removeCountry(Country $country): self
{
if ($this->countries->contains($country)) {
$this->countries->removeElement($country);
$country->removeNewBonus($this);
$this->addCollectionLog(LogActionEnum::REMOVE, 'country', $country);
}
return $this;
}
/**
* @return bool
*/
public function getRemoveCountries(): bool
{
return $this->removeCountries;
}
/**
* @param bool $removeCountries
* @return NewBonus
*/
public function setRemoveCountries(bool $removeCountries): self
{
$this->removeCountries = $removeCountries;
return $this;
}
/**
* @return Collection|Slot[]
*/
public function getSlots(): Collection
{
return $this->slots;
}
/**
* @param Slot $slot
* @return $this
*/
public function addSlot(Slot $slot): self
{
if (!$this->slots->contains($slot)) {
$this->slots[] = $slot;
$slot->addNewBonus($this);
$this->addCollectionLog(LogActionEnum::ADD, 'slot', $slot);
}
return $this;
}
/**
* @param Slot $slot
* @return $this
*/
public function removeSlot(Slot $slot): self
{
if ($this->slots->contains($slot)) {
$this->slots->removeElement($slot);
$slot->removeNewBonus($this);
$this->addCollectionLog(LogActionEnum::REMOVE, 'slot', $slot);
}
return $this;
}
/**
* @return Collection|IssueReport[]
*/
public function getIssueReports()
{
return $this->issueReports;
}
/**
* @param IssueReport $issueReport
* @return $this
*/
public function addIssueReport(IssueReport $issueReport): self
{
if (!$this->issueReports->contains($issueReport)) {
$this->issueReports[] = $issueReport;
$issueReport->setNewBonus($this);
$this->addCollectionLog(LogActionEnum::ADD, 'issueReport', $issueReport);
}
return $this;
}
/**
* @param IssueReport $issueReport
* @return $this
*/
public function removeIssueReport(IssueReport $issueReport): self
{
if ($this->issueReports->contains($issueReport)) {
$this->issueReports->removeElement($issueReport);
$issueReport->setNewBonus(null);
$this->addCollectionLog(LogActionEnum::REMOVE, 'issueReport', $issueReport);
}
return $this;
}
/**
* @return string|null
*/
public function getTncContent(): ?string
{
return $this->tncContent;
}
/**
* @param string|null $tncContent
* @return $this
*/
public function setTncContent(?string $tncContent): self
{
$this->tncContent = $tncContent;
return $this;
}
/**
* @return string|null
*/
public function getCode(): ?string
{
return $this->code;
}
/**
* @param string|null $code
* @return $this
*/
public function setCode(?string $code): self
{
$this->code = $code;
return $this;
}
/**
* @return string|null
*/
public function getSkinBg(): ?string
{
return $this->skinBg;
}
/**
* @param string|null $skinBg
* @return $this
*/
public function setSkinBg(?string $skinBg): self
{
$this->skinBg = $skinBg;
return $this;
}
/**
* @return string|null
*/
public function getSkinCharacter(): ?string
{
return $this->skinCharacter;
}
/**
* @param string|null $skinCharacter
* @return $this
*/
public function setSkinCharacter(?string $skinCharacter): self
{
$this->skinCharacter = $skinCharacter;
return $this;
}
/**
* @return bool|null
*/
public function getSpecialButtonTitle(): ?bool
{
return $this->specialButtonTitle;
}
/**
* @param bool|null $specialButtonTitle
* @return $this
*/
public function setSpecialButtonTitle(?bool $specialButtonTitle): self
{
$this->specialButtonTitle = $specialButtonTitle;
return $this;
}
/**
* @return bool|null
*/
public function getAnimatedButton(): ?bool
{
return $this->animatedButton;
}
/**
* @param bool|null $animatedButton
* @return $this
*/
public function setAnimatedButton(?bool $animatedButton): self
{
$this->animatedButton = $animatedButton;
return $this;
}
/**
* @return bool
*/
public function getClone(): bool
{
return $this->clone;
}
/**
* @param bool|null $clone
* @return $this
*/
public function setClone(bool $clone): self
{
$this->clone = $clone;
return $this;
}
/**
* @return bool|null
*/
public function getCopyCountryFromCasino(): ?bool
{
return $this->copyCountryFromCasino;
}
/**
* @param bool|null $copyCountryFromCasino
* @return $this
*/
public function setCopyCountryFromCasino(?bool $copyCountryFromCasino): self
{
$this->copyCountryFromCasino = $copyCountryFromCasino;
return $this;
}
/**
* @return bool|null
*/
public function getAddAllSites(): ?bool
{
return $this->addAllSites;
}
/**
* @param bool|null $addAllSites
* @return $this
*/
public function setAddAllSites(?bool $addAllSites): self
{
$this->addAllSites = $addAllSites;
return $this;
}
/**
* @return float|null
*/
public function getDepositMin(): ?float
{
return $this->depositMin;
}
/**
* @param float|null $depositMin
* @return $this
*/
public function setDepositMin(?float $depositMin): self
{
$this->depositMin = $depositMin;
return $this;
}
/**
* @return string|null
*/
public function getWageringRequirements(): ?string
{
return $this->wageringRequirements;
}
/**
* @param string|null $wageringRequirements
* @return $this
*/
public function setWageringRequirements(?string $wageringRequirements): self
{
$this->wageringRequirements = $wageringRequirements;
return $this;
}
/**
* @return int|null
*/
public function getFreeSpins(): ?int
{
return $this->freeSpins;
}
/**
* @param int|null $freeSpins
* @return $this
*/
public function setFreeSpins(?int $freeSpins): self
{
$this->freeSpins = $freeSpins;
return $this;
}
/**
* @return int|null
*/
public function getPercent(): ?int
{
return $this->percent;
}
/**
* @param int|null $percent
* @return $this
*/
public function setPercent(?int $percent): self
{
$this->percent = $percent;
return $this;
}
/**
* @return float|null
*/
public function getAmountMax(): ?float
{
return $this->amountMax;
}
/**
* @param float|null $amountMax
* @return $this
*/
public function setAmountMax(?float $amountMax): self
{
$this->amountMax = $amountMax;
return $this;
}
/**
* @return bool|null
*/
public function getCashable(): ?bool
{
return $this->cashable;
}
/**
* @param bool|null $cashable
* @return $this
*/
public function setCashable(?bool $cashable): self
{
$this->cashable = $cashable;
return $this;
}
/**
* @return string|null
*/
public function getTermsUrl(): ?string
{
return $this->termsUrl;
}
/**
* @param string|null $termsUrl
* @return $this
*/
public function setTermsUrl(?string $termsUrl): self
{
$this->termsUrl = $termsUrl;
return $this;
}
/**
* @return string|null
*/
public function getBonusUrl(): ?string
{
return $this->bonusUrl;
}
/**
* @param string|null $bonusUrl
* @return $this
*/
public function setBonusUrl(?string $bonusUrl): self
{
$this->bonusUrl = $bonusUrl;
return $this;
}
/**
* @return string|null
*/
public function getOriginalBonusUrl(): ?string
{
return $this->originalBonusUrl;
}
/**
* @param string|null $originalBonusUrl
* @return $this
*/
public function setOriginalBonusUrl(?string $originalBonusUrl): self
{
$this->originalBonusUrl = $originalBonusUrl;
return $this;
}
/**
* @return string|null
*/
public function getLabel(): ?string
{
return $this->label;
}
/**
* @param string|null $label
* @return $this
*/
public function setLabel(?string $label): self
{
$this->label = $label;
return $this;
}
/**
* @return DateTime|null
*/
public function getExpiredDate(): ?DateTime
{
return $this->expiredDate;
}
/**
* @param DateTime|null $expiredDate
* @return $this
*/
public function setExpiredDate(?DateTime $expiredDate): self
{
$this->expiredDate = $expiredDate;
return $this;
}
/**
* @return DateTime|null
*/
public function getStartPublishedDate(): ?DateTime
{
return $this->startPublishedDate;
}
/**
* @param DateTime|null $startPublishedDate
* @return $this
*/
public function setStartPublishedDate(?DateTime $startPublishedDate): self
{
$this->startPublishedDate = $startPublishedDate;
return $this;
}
/**
* @return DateTime|null
*/
public function getEndPublishedDate(): ?DateTime
{
return $this->endPublishedDate;
}
/**
* @param DateTime|null $endPublishedDate
* @return $this
*/
public function setEndPublishedDate(?DateTime $endPublishedDate): self
{
$this->endPublishedDate = $endPublishedDate;
return $this;
}
/**
* @return $this
* @deprecated
*/
public function setCache(): self
{
/* do not use this method. functionality moved to db side */
/** @var Country $country */
$this->cache = json_encode([
'currency' => ($currencies = $this->getCurrencies()) ? array_map(function ($currency) {
return $currency->getAlphabeticCode();
}, $currencies->toArray()) : null,
'bonusTypes' => ($bonuses = $this->getBonusTypes()) ? array_map(function ($bonus) {
return ['name' => $bonus->getName(), 'slug' => $bonus->getSlug()];
}, $bonuses->toArray()) : null,
'slots' => ($slots = $this->getSlots()) ? array_map(function ($slot) {
return ['name' => $slot->getName(), 'slug' => $slot->getSlug()];
}, $slots->toArray()) : null,
'bonusCategories' => ($categories = $this->getBonusCategories()) ? array_map(function ($category) {
return ['name' => $category->getName(), 'slug' => $category->getSlug(), 'type' => ($type = $category->getBonusType()) ? $category->getBonusType()->getSlug() : null];
}, $categories->toArray()) : null,
'casinoRestrictedCountries' => ($restrictedCountries = $this->getCasino()->getRestrictedCountriesFact()) ? array_map(function ($country) {
return $country->getAlpha2();
}, $restrictedCountries->toArray()) : null,
'affiliateUrl' => $this->getCasino()->getInfo()->getAffiliateUrl(),
]);
return $this;
}
/**
* @return string
*/
public function getTitleShort(): ?string
{
return $this->titleShort;
}
/**
* @param string|null $titleShort
* @return $this
*/
public function setTitleShort(?string $titleShort): self
{
$this->titleShort = $titleShort;
return $this;
}
/**
* @return string
*/
public function getMaxCashout(): ?string
{
return $this->maxCashout;
}
public function setMaxCashout(?string $maxCashout): self
{
$this->maxCashout = $maxCashout;
return $this;
}
/**
* @return string
*/
public function getMaxBet(): ?string
{
return $this->maxBet;
}
public function setMaxBet(?string $maxBet): self
{
$this->maxBet = $maxBet;
return $this;
}
/**
* @return string
*/
public function getFreeSpinsConditions(): ?string
{
return $this->freeSpinsConditions;
}
public function setFreeSpinsConditions(?string $freeSpinsConditions): self
{
$this->freeSpinsConditions = $freeSpinsConditions;
return $this;
}
public function getExpiresAfter(): ?int
{
return $this->expiresAfter;
}
public function setExpiresAfter(?int $expiresAfter): self
{
$this->expiresAfter = $expiresAfter;
return $this;
}
public function getName(): string
{
return $this->getTitleShort();
}
/**
* @param bool $sponsored
* @return self
*/
public function setSponsored(bool $sponsored): self
{
$this->sponsored = $sponsored;
return $this;
}
/**
* @return ?bool
*/
public function getSponsored(): ?bool
{
return $this->sponsored;
}
/**
* @return ?int
*/
public function getOfferType(): ?int
{
return $this->offerType;
}
/**
* @param ?int $type
* @return $this
*/
public function setOfferType(?int $type): self
{
BonusOfferTypeEnum::assertExists($type);
$this->offerType = $type;
return $this;
}
/**
* @return Collection
*/
public function getBonusTags(): Collection
{
return $this->bonusTags;
}
/**
* @return int
*/
public function getBonusTagsCount(): int
{
return $this->bonusTags->count();
}
/**
* @param BonusTag $bonusTag
* @return $this
*/
public function addBonusTag(BonusTag $bonusTag): self
{
if (!$this->bonusTags->contains($bonusTag)) {
$this->bonusTags[] = $bonusTag;
$bonusTag->setNewBonus($this);
}
return $this;
}
/**
* @param BonusTag $bonusTag
* @return $this
*/
public function removeBonusTag(BonusTag $bonusTag): self
{
if ($this->bonusTags->contains($bonusTag)) {
$this->bonusTags->removeElement($bonusTag);
}
return $this;
}
/**
* @return float
*/
public function getBonusGenerosity(): float
{
return $this->bonusGenerosity;
}
/**
* @param float $bonusGenerosity
* @return $this
*/
public function setBonusGenerosity(float $bonusGenerosity): self
{
$this->bonusGenerosity = $bonusGenerosity;
return $this;
}
/**
* @return float
*/
public function getSummator(): float
{
return $this->summator;
}
/**
* @param float $summator
* @return $this
*/
public function setSummator(float $summator): self
{
$this->summator = $summator;
return $this;
}
/**
* @return Collection
*/
public function getBonusOwners(): Collection
{
return $this->bonusOwners;
}
/**
* @param UserBonus $userBonus
* @return $this
*/
public function addBonusOwner(UserBonus $userBonus): self
{
if (!$this->bonusOwners->contains($userBonus)) {
$this->bonusOwners[] = $userBonus;
$userBonus->setBonus($this);
}
return $this;
}
/**
* @param UserBonus $userBonus
* @return $this
*/
public function removeBonusOwner(UserBonus $userBonus): self
{
if ($this->bonusOwners->removeElement($userBonus)) {
if ($userBonus->getBonus() === $this) {
$userBonus->setBonus(null);
}
}
return $this;
}
/**
* @return ?int
*/
public function getPrice(): ?int
{
return $this->price;
}
/**
* @param ?int $price
* @return $this
*/
public function setPrice(?int $price): self
{
$this->price = $price;
return $this;
}
/**
* @return Collection
*/
public function getTitles(): Collection
{
return $this->titles;
}
/**
* @param BonusTitle $bonusTitle
* @return $this
*/
public function addTitle(BonusTitle $bonusTitle): self
{
if (!$this->titles->contains($bonusTitle)) {
$this->titles->add($bonusTitle);
$bonusTitle->setBonus($this);
}
return $this;
}
/**
* @param BonusTitle $bonusTitle
* @return $this
*/
public function removeTitle(BonusTitle $bonusTitle): self
{
if ($this->titles->removeElement($bonusTitle) && $bonusTitle->getBonus() === $this) {
$bonusTitle->setBonus(null);
}
return $this;
}
}