<?php
namespace App\Entity\ContentDistribution;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
*
* @ORM\Table(
* name="content_distributor_feeds"
* )
*/
class ContentDistributorFeed
{
public function __construct(ContentDistributor $contentDistributor, string $category, string $fileSuffix)
{
$this->category = $category;
$this->fileSuffix = $fileSuffix;
$this->contentDistributor = $contentDistributor;
$this->maxRecurrentJobAgeInDays = null;
$this->maxForwardsToRecurrentJobPerMonth = null;
$this->minAmountOfWordsForDescriptionTexts = null;
$this->basePrice = 0;
$this->generalValueGaugeType = null;
}
/**
* @var string
*
* @ORM\GeneratedValue(strategy="CUSTOM")
*
* @ORM\CustomIdGenerator(class="App\Utility\DatabaseIdGenerator")
*
* @ORM\Column(name="id", type="guid")
*
* @ORM\Id
*/
protected $id;
public function getId(): string
{
return $this->id;
}
/**
* @ORM\Column(name="category", type="string", length=128)
*/
protected string $category;
public function getCategory(): string
{
return $this->category;
}
public function setCategory(string $category): void
{
$this->category = $category;
}
/**
* @ORM\Column(name="file_suffix", type="string", length=128)
*/
protected string $fileSuffix;
public function getFileSuffix(): string
{
return $this->fileSuffix;
}
public function setFileSuffix(string $fileSuffix): void
{
$this->fileSuffix = $fileSuffix;
}
/**
* @ORM\ManyToOne(targetEntity="App\Entity\ContentDistribution\ContentDistributor", inversedBy="contentDistributorFeeds", cascade={"persist"})
*
* @ORM\JoinColumn(name="content_distributors_id", referencedColumnName="id", nullable=false, onDelete="CASCADE")
*/
protected ContentDistributor $contentDistributor;
public function getContentDistributor(): ContentDistributor
{
return $this->contentDistributor;
}
/**
* @ORM\Column(name="max_recurrent_job_age_in_days", type="integer", nullable=true)
*/
private ?int $maxRecurrentJobAgeInDays;
public function getMaxRecurrentJobAgeInDays(): ?int
{
if (!is_null($this->maxRecurrentJobAgeInDays)) {
return $this->maxRecurrentJobAgeInDays;
} else {
return $this->contentDistributor->getMaxRecurrentJobAgeInDays();
}
}
public function setMaxRecurrentJobAgeInDays(?int $maxRecurrentJobAgeInDays): void
{
$this->maxRecurrentJobAgeInDays = $maxRecurrentJobAgeInDays;
}
/**
* @ORM\Column(name="max_forwards_to_recurrent_job_per_month", type="integer", nullable=true)
*/
private ?int $maxForwardsToRecurrentJobPerMonth;
public function getMaxForwardsToRecurrentJobPerMonth(): ?int
{
if (!is_null($this->maxForwardsToRecurrentJobPerMonth)) {
return $this->maxForwardsToRecurrentJobPerMonth;
} else {
return $this->contentDistributor->getMaxForwardsToRecurrentJobPerMonth();
}
}
public function setMaxForwardsToRecurrentJobPerMonth(?int $maxForwardsToRecurrentJobPerMonth): void
{
$this->maxForwardsToRecurrentJobPerMonth = $maxForwardsToRecurrentJobPerMonth;
}
/**
* @ORM\Column(name="min_amount_of_words_for_description_texts", type="integer", nullable=true)
*/
private ?int $minAmountOfWordsForDescriptionTexts;
public function getMinAmountOfWordsForDescriptionTexts(): ?int
{
if (!is_null($this->minAmountOfWordsForDescriptionTexts)) {
return $this->minAmountOfWordsForDescriptionTexts;
} else {
return $this->contentDistributor->getMinAmountOfWordsForDescriptionTexts();
}
}
public function setMinAmountOfWordsForDescriptionTexts(?int $minAmountOfWordsForDescriptionTexts): void
{
$this->minAmountOfWordsForDescriptionTexts = $minAmountOfWordsForDescriptionTexts;
}
/**
* @ORM\Column(name="base_price", type="float", nullable=false)
*/
private float $basePrice;
public function getBasePrice(): float
{
return $this->basePrice;
}
public function setBasePrice(float $basePrice): void
{
$this->basePrice = $basePrice;
}
/**
* @ORM\Column(name="general_value_gauge_type", type="integer", nullable=true)
*/
private ?int $generalValueGaugeType;
public function getGeneralValueGaugeType(): ?int
{
return $this->generalValueGaugeType;
}
}