src/App/Entity/ContentDistribution/ContentDistributorFeed.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity\ContentDistribution;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5. * @ORM\Entity
  6. *
  7. * @ORM\Table(
  8. * name="content_distributor_feeds"
  9. * )
  10. */
  11. class ContentDistributorFeed
  12. {
  13. public function __construct(ContentDistributor $contentDistributor, string $category, string $fileSuffix)
  14. {
  15. $this->category = $category;
  16. $this->fileSuffix = $fileSuffix;
  17. $this->contentDistributor = $contentDistributor;
  18. $this->maxRecurrentJobAgeInDays = null;
  19. $this->maxForwardsToRecurrentJobPerMonth = null;
  20. $this->minAmountOfWordsForDescriptionTexts = null;
  21. $this->basePrice = 0;
  22. $this->generalValueGaugeType = null;
  23. }
  24. /**
  25. * @var string
  26. *
  27. * @ORM\GeneratedValue(strategy="CUSTOM")
  28. *
  29. * @ORM\CustomIdGenerator(class="App\Utility\DatabaseIdGenerator")
  30. *
  31. * @ORM\Column(name="id", type="guid")
  32. *
  33. * @ORM\Id
  34. */
  35. protected $id;
  36. public function getId(): string
  37. {
  38. return $this->id;
  39. }
  40. /**
  41. * @ORM\Column(name="category", type="string", length=128)
  42. */
  43. protected string $category;
  44. public function getCategory(): string
  45. {
  46. return $this->category;
  47. }
  48. public function setCategory(string $category): void
  49. {
  50. $this->category = $category;
  51. }
  52. /**
  53. * @ORM\Column(name="file_suffix", type="string", length=128)
  54. */
  55. protected string $fileSuffix;
  56. public function getFileSuffix(): string
  57. {
  58. return $this->fileSuffix;
  59. }
  60. public function setFileSuffix(string $fileSuffix): void
  61. {
  62. $this->fileSuffix = $fileSuffix;
  63. }
  64. /**
  65. * @ORM\ManyToOne(targetEntity="App\Entity\ContentDistribution\ContentDistributor", inversedBy="contentDistributorFeeds", cascade={"persist"})
  66. *
  67. * @ORM\JoinColumn(name="content_distributors_id", referencedColumnName="id", nullable=false, onDelete="CASCADE")
  68. */
  69. protected ContentDistributor $contentDistributor;
  70. public function getContentDistributor(): ContentDistributor
  71. {
  72. return $this->contentDistributor;
  73. }
  74. /**
  75. * @ORM\Column(name="max_recurrent_job_age_in_days", type="integer", nullable=true)
  76. */
  77. private ?int $maxRecurrentJobAgeInDays;
  78. public function getMaxRecurrentJobAgeInDays(): ?int
  79. {
  80. if (!is_null($this->maxRecurrentJobAgeInDays)) {
  81. return $this->maxRecurrentJobAgeInDays;
  82. } else {
  83. return $this->contentDistributor->getMaxRecurrentJobAgeInDays();
  84. }
  85. }
  86. public function setMaxRecurrentJobAgeInDays(?int $maxRecurrentJobAgeInDays): void
  87. {
  88. $this->maxRecurrentJobAgeInDays = $maxRecurrentJobAgeInDays;
  89. }
  90. /**
  91. * @ORM\Column(name="max_forwards_to_recurrent_job_per_month", type="integer", nullable=true)
  92. */
  93. private ?int $maxForwardsToRecurrentJobPerMonth;
  94. public function getMaxForwardsToRecurrentJobPerMonth(): ?int
  95. {
  96. if (!is_null($this->maxForwardsToRecurrentJobPerMonth)) {
  97. return $this->maxForwardsToRecurrentJobPerMonth;
  98. } else {
  99. return $this->contentDistributor->getMaxForwardsToRecurrentJobPerMonth();
  100. }
  101. }
  102. public function setMaxForwardsToRecurrentJobPerMonth(?int $maxForwardsToRecurrentJobPerMonth): void
  103. {
  104. $this->maxForwardsToRecurrentJobPerMonth = $maxForwardsToRecurrentJobPerMonth;
  105. }
  106. /**
  107. * @ORM\Column(name="min_amount_of_words_for_description_texts", type="integer", nullable=true)
  108. */
  109. private ?int $minAmountOfWordsForDescriptionTexts;
  110. public function getMinAmountOfWordsForDescriptionTexts(): ?int
  111. {
  112. if (!is_null($this->minAmountOfWordsForDescriptionTexts)) {
  113. return $this->minAmountOfWordsForDescriptionTexts;
  114. } else {
  115. return $this->contentDistributor->getMinAmountOfWordsForDescriptionTexts();
  116. }
  117. }
  118. public function setMinAmountOfWordsForDescriptionTexts(?int $minAmountOfWordsForDescriptionTexts): void
  119. {
  120. $this->minAmountOfWordsForDescriptionTexts = $minAmountOfWordsForDescriptionTexts;
  121. }
  122. /**
  123. * @ORM\Column(name="base_price", type="float", nullable=false)
  124. */
  125. private float $basePrice;
  126. public function getBasePrice(): float
  127. {
  128. return $this->basePrice;
  129. }
  130. public function setBasePrice(float $basePrice): void
  131. {
  132. $this->basePrice = $basePrice;
  133. }
  134. /**
  135. * @ORM\Column(name="general_value_gauge_type", type="integer", nullable=true)
  136. */
  137. private ?int $generalValueGaugeType;
  138. public function getGeneralValueGaugeType(): ?int
  139. {
  140. return $this->generalValueGaugeType;
  141. }
  142. }