<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\ORM\Mapping\OneToMany;
/**
* @ORM\Entity(repositoryClass="App\Repository\MmpOffersRepository")
* @ORM\Table(indexes={@ORM\Index(name="mobile_app", columns={"mobile_app"}),@ORM\Index(name="mmp_source", columns={"mmp_source"}),@ORM\Index(name="is_deleted", columns={"is_deleted"})})
*/
class MmpOffers{
/**
* @ORM\Column(type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @OneToMany(targetEntity="App\Entity\AdjustOfferCampaignMapping", mappedBy="mmpOffer")
*/
private $adjustOfferCampaignMapping;
/**
* @ORM\Column(type="string", nullable=true)
*/
private $advertiser;
/**
* @ORM\Column(type="string", nullable=false)
*/
private $offerName;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $hoOfferId;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $mmpMobileAppsId;
/**
* @ORM\Column(type="string", nullable=false)
*/
private $offerCountry;
/**
* @ORM\Column(type="string", nullable=true)
*/
private $offerRegion;
/**
* @ORM\Column(type="string", nullable=true)
*/
private $offerCity;
/**
* @ORM\Column(type="string", nullable=true)
*/
private $mobileApp;
/**
* @ORM\Column(type="string", nullable=true)
*/
private $defaultRevenueModel;
/**
* @ORM\Column(type="string", nullable=true)
*/
private $defaultPayoutModel;
/**
* @ORM\Column(type="string", nullable=true)
*/
private $defaultRevenueEvent;
/**
* @ORM\Column(type="decimal", scale=4, nullable=false)
*/
private $defaultRevenue;
/**
* @ORM\Column(type="decimal", scale=4, nullable=false)
*/
private $defaultPayout;
/**
* @ORM\Column(type="boolean", nullable=true, options={"default"=false})
*/
private $isDeleted;
/**
* @ORM\Column(type="boolean", nullable=true, options={"default"=false})
*/
private $isHoOfferMappingEnabled;
/**
* @ORM\Column(type="string", nullable=true)
*/
private $addedBy;
/**
* @ORM\Column(type="string", nullable=true)
*/
private $mmpSource;
/**
* @ORM\Column(type="string", nullable=true)
*/
private $calculateCostBy;
/**
* @ORM\Column(type="string", nullable=true)
*/
private $mmpAdjustAttributionType;
/**
* @ORM\Column(type="string", length=20, nullable=true)
*/
private $offerType;
/**
* @ORM\Column(type="boolean", nullable=true, options={"default"=false})
*/
private $isHoAffiliateWhitelistEnabledForEmail;
/**
* @ORM\Column(type="array", nullable=true)
*/
private $whitelistedHoAffiliateIdsForEmail;
/**
* @ORM\Column(type="boolean", nullable=true, options={"default"=false})
*/
private $enableCaps;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $dailyPayoutCap;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $monthlyPayoutCap;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $lifetimePayoutCap;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $dailyRevenueCap;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $monthlyRevenueCap;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $lifetimeRevenueCap;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $dailyConversionCap;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $monthlyConversionCap;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $lifetimeConversionCap;
/**
* @ORM\Column(type="decimal", precision=12, scale=2, nullable=true)
*/
private $monthlyBudgetGeneratedFromMMPReport;
/**
* @ORM\Column(type="datetime")
*/
private $dateUpdated;
/**
* @ORM\Column(type="datetime")
*/
private $dateInserted;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $kpi;
/**
* @ORM\Column(type="boolean", nullable=true, options={"default"=true})
*/
private $isPrivatePublisherCabinet;
/**
* @OneToMany(targetEntity="App\Entity\MmpOfferPublisherMapping", mappedBy="mmpOffer", cascade={"persist", "remove"})
*/
private $publisherMappings;
public function __construct()
{
$this->adjustOfferCampaignMapping = new ArrayCollection();
$this->publisherMappings = new ArrayCollection();
}
/**
* Get id.
*
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* Set advertiser.
*
* @param string|null $advertiser
*
* @return MmpOffers
*/
public function setAdvertiser($advertiser = null)
{
$this->advertiser = $advertiser;
return $this;
}
/**
* Get advertiser.
*
* @return string|null
*/
public function getAdvertiser()
{
return $this->advertiser;
}
/**
* Set offerName.
*
* @param string $offerName
*
* @return MmpOffers
*/
public function setOfferName($offerName)
{
$this->offerName = $offerName;
return $this;
}
/**
* Get offerName.
*
* @return string
*/
public function getOfferName()
{
return $this->offerName;
}
/**
* Set hoOfferId.
*
* @param int|null $hoOfferId
*
* @return MmpOffers
*/
public function setHoOfferId($hoOfferId = null)
{
$this->hoOfferId = $hoOfferId;
return $this;
}
/**
* Get hoOfferId.
*
* @return int|null
*/
public function getHoOfferId()
{
return $this->hoOfferId;
}
/**
* Set offerCountry.
*
* @param string $offerCountry
*
* @return MmpOffers
*/
public function setOfferCountry($offerCountry)
{
$this->offerCountry = $offerCountry;
return $this;
}
/**
* Get offerCountry.
*
* @return string
*/
public function getOfferCountry()
{
return $this->offerCountry;
}
/**
* Set offerRegion.
*
* @param string|null $offerRegion
*
* @return MmpOffers
*/
public function setOfferRegion($offerRegion = null)
{
$this->offerRegion = $offerRegion;
return $this;
}
/**
* Get offerRegion.
*
* @return string|null
*/
public function getOfferRegion()
{
return $this->offerRegion;
}
/**
* Set offerCity.
*
* @param string|null $offerCity
*
* @return MmpOffers
*/
public function setOfferCity($offerCity = null)
{
$this->offerCity = $offerCity;
return $this;
}
/**
* Get offerCity.
*
* @return string|null
*/
public function getOfferCity()
{
return $this->offerCity;
}
/**
* Set mobileApp.
*
* @param string|null $mobileApp
*
* @return MmpOffers
*/
public function setMobileApp($mobileApp = null)
{
$this->mobileApp = $mobileApp;
return $this;
}
/**
* Get mobileApp.
*
* @return string|null
*/
public function getMobileApp()
{
return $this->mobileApp;
}
/**
* Set defaultRevenueModel.
*
* @param string|null $defaultRevenueModel
*
* @return MmpOffers
*/
public function setDefaultRevenueModel($defaultRevenueModel = null)
{
$this->defaultRevenueModel = $defaultRevenueModel;
return $this;
}
/**
* Get defaultRevenueModel.
*
* @return string|null
*/
public function getDefaultRevenueModel()
{
return $this->defaultRevenueModel;
}
/**
* Set defaultPayoutModel.
*
* @param string|null $defaultPayoutModel
*
* @return MmpOffers
*/
public function setDefaultPayoutModel($defaultPayoutModel = null)
{
$this->defaultPayoutModel = $defaultPayoutModel;
return $this;
}
/**
* Get defaultPayoutModel.
*
* @return string|null
*/
public function getDefaultPayoutModel()
{
return $this->defaultPayoutModel;
}
/**
* Set defaultRevenueEvent.
*
* @param string|null $defaultRevenueEvent
*
* @return MmpOffers
*/
public function setDefaultRevenueEvent($defaultRevenueEvent = null)
{
$this->defaultRevenueEvent = $defaultRevenueEvent;
return $this;
}
/**
* Get defaultRevenueEvent.
*
* @return string|null
*/
public function getDefaultRevenueEvent()
{
return $this->defaultRevenueEvent;
}
/**
* Set defaultRevenue.
*
* @param string $defaultRevenue
*
* @return MmpOffers
*/
public function setDefaultRevenue($defaultRevenue)
{
$this->defaultRevenue = $defaultRevenue;
return $this;
}
/**
* Get defaultRevenue.
*
* @return string
*/
public function getDefaultRevenue()
{
return $this->defaultRevenue;
}
/**
* Set defaultPayout.
*
* @param string $defaultPayout
*
* @return MmpOffers
*/
public function setDefaultPayout($defaultPayout)
{
$this->defaultPayout = $defaultPayout;
return $this;
}
/**
* Get defaultPayout.
*
* @return string
*/
public function getDefaultPayout()
{
return $this->defaultPayout;
}
/**
* Set isDeleted.
*
* @param bool|null $isDeleted
*
* @return MmpOffers
*/
public function setIsDeleted($isDeleted = null)
{
$this->isDeleted = $isDeleted;
return $this;
}
/**
* Get isDeleted.
*
* @return bool|null
*/
public function getIsDeleted()
{
return $this->isDeleted;
}
/**
* Set isHoOfferMappingEnabled.
*
* @param bool|null $isHoOfferMappingEnabled
*
* @return MmpOffers
*/
public function setIsHoOfferMappingEnabled($isHoOfferMappingEnabled = null)
{
$this->isHoOfferMappingEnabled = $isHoOfferMappingEnabled;
return $this;
}
/**
* Get isHoOfferMappingEnabled.
*
* @return bool|null
*/
public function getIsHoOfferMappingEnabled()
{
return $this->isHoOfferMappingEnabled;
}
/**
* Set addedBy.
*
* @param string|null $addedBy
*
* @return MmpOffers
*/
public function setAddedBy($addedBy = null)
{
$this->addedBy = $addedBy;
return $this;
}
/**
* Get addedBy.
*
* @return string|null
*/
public function getAddedBy()
{
return $this->addedBy;
}
/**
* Set mmpSource.
*
* @param string|null $mmpSource
*
* @return MmpOffers
*/
public function setMmpSource($mmpSource = null)
{
$this->mmpSource = $mmpSource;
return $this;
}
/**
* Get mmpSource.
*
* @return string|null
*/
public function getMmpSource()
{
return $this->mmpSource;
}
/**
* Set calculateCostBy.
*
* @param string|null $calculateCostBy
*
* @return MmpOffers
*/
public function setCalculateCostBy($calculateCostBy = null)
{
$this->calculateCostBy = $calculateCostBy;
return $this;
}
/**
* Get calculateCostBy.
*
* @return string|null
*/
public function getCalculateCostBy()
{
return $this->calculateCostBy;
}
/**
* Set mmpAdjustAttributionType.
*
* @param string|null $mmpAdjustAttributionType
*
* @return MmpOffers
*/
public function setMmpAdjustAttributionType($mmpAdjustAttributionType = null)
{
$this->mmpAdjustAttributionType = $mmpAdjustAttributionType;
return $this;
}
/**
* Get mmpAdjustAttributionType.
*
* @return string|null
*/
public function getMmpAdjustAttributionType()
{
return $this->mmpAdjustAttributionType;
}
/**
* Set offerType.
*
* @param string|null $offerType
*
* @return MmpOffers
*/
public function setOfferType($offerType = null)
{
$this->offerType = $offerType;
return $this;
}
/**
* Get offerType.
*
* @return string|null
*/
public function getOfferType()
{
return $this->offerType;
}
/**
* Set isHoAffiliateWhitelistEnabledForEmail.
*
* @param bool|null $isHoAffiliateWhitelistEnabledForEmail
*
* @return MmpOffers
*/
public function setIsHoAffiliateWhitelistEnabledForEmail($isHoAffiliateWhitelistEnabledForEmail = null)
{
$this->isHoAffiliateWhitelistEnabledForEmail = $isHoAffiliateWhitelistEnabledForEmail;
return $this;
}
/**
* Get isHoAffiliateWhitelistEnabledForEmail.
*
* @return bool|null
*/
public function getIsHoAffiliateWhitelistEnabledForEmail()
{
return $this->isHoAffiliateWhitelistEnabledForEmail;
}
/**
* Set whitelistedHoAffiliateIdsForEmail.
*
* @param array|null $whitelistedHoAffiliateIdsForEmail
*
* @return MmpOffers
*/
public function setWhitelistedHoAffiliateIdsForEmail($whitelistedHoAffiliateIdsForEmail = null)
{
$this->whitelistedHoAffiliateIdsForEmail = $whitelistedHoAffiliateIdsForEmail;
return $this;
}
/**
* Get whitelistedHoAffiliateIdsForEmail.
*
* @return array|null
*/
public function getWhitelistedHoAffiliateIdsForEmail()
{
return $this->whitelistedHoAffiliateIdsForEmail;
}
/**
* Set enableCaps.
*
* @param bool|null $enableCaps
*
* @return MmpOffers
*/
public function setEnableCaps($enableCaps = null)
{
$this->enableCaps = $enableCaps;
return $this;
}
/**
* Get enableCaps.
*
* @return bool|null
*/
public function getEnableCaps()
{
return $this->enableCaps;
}
/**
* Set dailyPayoutCap.
*
* @param int|null $dailyPayoutCap
*
* @return MmpOffers
*/
public function setDailyPayoutCap($dailyPayoutCap = null)
{
$this->dailyPayoutCap = $dailyPayoutCap;
return $this;
}
/**
* Get dailyPayoutCap.
*
* @return int|null
*/
public function getDailyPayoutCap()
{
return $this->dailyPayoutCap;
}
/**
* Set monthlyPayoutCap.
*
* @param int|null $monthlyPayoutCap
*
* @return MmpOffers
*/
public function setMonthlyPayoutCap($monthlyPayoutCap = null)
{
$this->monthlyPayoutCap = $monthlyPayoutCap;
return $this;
}
/**
* Get monthlyPayoutCap.
*
* @return int|null
*/
public function getMonthlyPayoutCap()
{
return $this->monthlyPayoutCap;
}
/**
* Set lifetimePayoutCap.
*
* @param int|null $lifetimePayoutCap
*
* @return MmpOffers
*/
public function setLifetimePayoutCap($lifetimePayoutCap = null)
{
$this->lifetimePayoutCap = $lifetimePayoutCap;
return $this;
}
/**
* Get lifetimePayoutCap.
*
* @return int|null
*/
public function getLifetimePayoutCap()
{
return $this->lifetimePayoutCap;
}
/**
* Set dailyRevenueCap.
*
* @param int|null $dailyRevenueCap
*
* @return MmpOffers
*/
public function setDailyRevenueCap($dailyRevenueCap = null)
{
$this->dailyRevenueCap = $dailyRevenueCap;
return $this;
}
/**
* Get dailyRevenueCap.
*
* @return int|null
*/
public function getDailyRevenueCap()
{
return $this->dailyRevenueCap;
}
/**
* Set monthlyRevenueCap.
*
* @param int|null $monthlyRevenueCap
*
* @return MmpOffers
*/
public function setMonthlyRevenueCap($monthlyRevenueCap = null)
{
$this->monthlyRevenueCap = $monthlyRevenueCap;
return $this;
}
/**
* Get monthlyRevenueCap.
*
* @return int|null
*/
public function getMonthlyRevenueCap()
{
return $this->monthlyRevenueCap;
}
/**
* Set lifetimeRevenueCap.
*
* @param int|null $lifetimeRevenueCap
*
* @return MmpOffers
*/
public function setLifetimeRevenueCap($lifetimeRevenueCap = null)
{
$this->lifetimeRevenueCap = $lifetimeRevenueCap;
return $this;
}
/**
* Get lifetimeRevenueCap.
*
* @return int|null
*/
public function getLifetimeRevenueCap()
{
return $this->lifetimeRevenueCap;
}
/**
* Set dateUpdated.
*
* @param \DateTime $dateUpdated
*
* @return MmpOffers
*/
public function setDateUpdated($dateUpdated)
{
$this->dateUpdated = $dateUpdated;
return $this;
}
/**
* Get dateUpdated.
*
* @return \DateTime
*/
public function getDateUpdated()
{
return $this->dateUpdated;
}
/**
* Set dateInserted.
*
* @param \DateTime $dateInserted
*
* @return MmpOffers
*/
public function setDateInserted($dateInserted)
{
$this->dateInserted = $dateInserted;
return $this;
}
/**
* Get dateInserted.
*
* @return \DateTime
*/
public function getDateInserted()
{
return $this->dateInserted;
}
/**
* Set kpi.
*
* @param string|null $kpi
*
* @return MmpOffers
*/
public function setKpi($kpi)
{
$this->kpi = $kpi;
return $this;
}
/**
* Get kpi.
*
* @return string|null
*/
public function getKpi()
{
return $this->kpi;
}
/**
* Set dailyConversionCap.
*
* @param int|null $dailyConversionCap
*
* @return MmpOffers
*/
public function setDailyConversionCap($dailyConversionCap = null)
{
$this->dailyConversionCap = $dailyConversionCap;
return $this;
}
/**
* Get dailyConversionCap.
*
* @return int|null
*/
public function getDailyConversionCap()
{
return $this->dailyConversionCap;
}
/**
* Set monthlyConversionCap.
*
* @param int|null $monthlyConversionCap
*
* @return MmpOffers
*/
public function setMonthlyConversionCap($monthlyConversionCap = null)
{
$this->monthlyConversionCap = $monthlyConversionCap;
return $this;
}
/**
* Get monthlyConversionCap.
*
* @return int|null
*/
public function getMonthlyConversionCap()
{
return $this->monthlyConversionCap;
}
/**
* Set lifetimeConversionCap.
*
* @param int|null $lifetimeConversionCap
*
* @return MmpOffers
*/
public function setLifetimeConversionCap($lifetimeConversionCap = null)
{
$this->lifetimeConversionCap = $lifetimeConversionCap;
return $this;
}
/**
* Get lifetimeConversionCap.
*
* @return int|null
*/
public function getLifetimeConversionCap()
{
return $this->lifetimeConversionCap;
}
/**
* Set monthlyBudgetGeneratedFromMMPReport.
*
* @param string|null $monthlyBudgetGeneratedFromMMPReport
*
* @return MmpOffers
*/
public function setMonthlyBudgetGeneratedFromMMPReport($monthlyBudgetGeneratedFromMMPReport = null)
{
$this->monthlyBudgetGeneratedFromMMPReport = $monthlyBudgetGeneratedFromMMPReport;
return $this;
}
/**
* Get monthlyBudgetGeneratedFromMMPReport.
*
* @return string|null
*/
public function getMonthlyBudgetGeneratedFromMMPReport()
{
return $this->monthlyBudgetGeneratedFromMMPReport;
}
public function isIsDeleted(): ?bool
{
return $this->isDeleted;
}
public function isIsHoOfferMappingEnabled(): ?bool
{
return $this->isHoOfferMappingEnabled;
}
public function isIsHoAffiliateWhitelistEnabledForEmail(): ?bool
{
return $this->isHoAffiliateWhitelistEnabledForEmail;
}
public function isEnableCaps(): ?bool
{
return $this->enableCaps;
}
/**
* @return Collection<int, AdjustOfferCampaignMapping>
*/
public function getAdjustOfferCampaignMapping(): Collection
{
return $this->adjustOfferCampaignMapping;
}
public function addAdjustOfferCampaignMapping(AdjustOfferCampaignMapping $adjustOfferCampaignMapping): self
{
if (!$this->adjustOfferCampaignMapping->contains($adjustOfferCampaignMapping)) {
$this->adjustOfferCampaignMapping[] = $adjustOfferCampaignMapping;
$adjustOfferCampaignMapping->setMmpOffer($this);
}
return $this;
}
public function removeAdjustOfferCampaignMapping(AdjustOfferCampaignMapping $adjustOfferCampaignMapping): self
{
if ($this->adjustOfferCampaignMapping->removeElement($adjustOfferCampaignMapping)) {
// set the owning side to null (unless already changed)
if ($adjustOfferCampaignMapping->getMmpOffer() === $this) {
$adjustOfferCampaignMapping->setMmpOffer(null);
}
}
return $this;
}
public function getMmpMobileAppsId(): ?int
{
return $this->mmpMobileAppsId;
}
public function setMmpMobileAppsId(?int $mmpMobileAppsId): self
{
$this->mmpMobileAppsId = $mmpMobileAppsId;
return $this;
}
public function getIsPrivatePublisherCabinet(): ?bool
{
return $this->isPrivatePublisherCabinet;
}
public function setIsPrivatePublisherCabinet(?bool $isPrivatePublisherCabinet): self
{
$this->isPrivatePublisherCabinet = $isPrivatePublisherCabinet;
return $this;
}
/**
* @return Collection|MmpOfferPublisherMapping[]
*/
public function getPublisherMappings(): Collection
{
return $this->publisherMappings;
}
public function addPublisherMapping(MmpOfferPublisherMapping $mapping): self
{
if (!$this->publisherMappings->contains($mapping)) {
$this->publisherMappings[] = $mapping;
$mapping->setMmpOffer($this);
}
return $this;
}
public function removePublisherMapping(MmpOfferPublisherMapping $mapping): self
{
if ($this->publisherMappings->removeElement($mapping)) {
// set the owning side to null (unless already changed)
if ($mapping->getMmpOffer() === $this) {
$mapping->setMmpOffer(null);
}
}
return $this;
}
/**
* Get all allowed affiliate IDs for this offer
* @return array
*/
public function getAllowedAffiliateIds(): array
{
$ids = [];
foreach ($this->publisherMappings as $mapping) {
if ($mapping->isAllowed()) {
$ids[] = $mapping->getMafoAffiliateId();
}
}
return $ids;
}
/**
* Get all blocked affiliate IDs for this offer
* @return array
*/
public function getBlockedAffiliateIds(): array
{
$ids = [];
foreach ($this->publisherMappings as $mapping) {
if ($mapping->isBlocked()) {
$ids[] = $mapping->getMafoAffiliateId();
}
}
return $ids;
}
}