Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

190 lines
4.1KB

  1. <?php
  2. namespace Lc\PietroBundle\Model\Workshop;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Lc\SovBundle\Doctrine\EntityInterface;
  7. use Lc\SovBundle\Doctrine\Pattern\AbstractFullEntity;
  8. /**
  9. * @ORM\MappedSuperclass()
  10. */
  11. abstract class Workshop extends AbstractFullEntity implements WorkshopInterface, EntityInterface
  12. {
  13. /**
  14. * @ORM\ManyToOne(targetEntity="Lc\PietroBundle\Model\Workshop\WorkshopThematicInterface", inversedBy="workshops")
  15. */
  16. protected $workshopThematic;
  17. /**
  18. * @ORM\ManyToOne(targetEntity="Lc\PietroBundle\Model\Workshop\TypeInterface", inversedBy="workshops")
  19. */
  20. protected $type;
  21. /**
  22. * @ORM\OneToMany(targetEntity="Lc\PietroBundle\Model\Workshop\EntryInterface", mappedBy="workshop", cascade={"persist", "remove"})
  23. */
  24. protected $entries;
  25. /**
  26. * @ORM\Column(type="string", length=256, nullable=true)
  27. */
  28. protected $hook;
  29. /**
  30. * @ORM\OneToMany(targetEntity="Lc\PietroBundle\Model\Workshop\SolutionInterface", mappedBy="workshop", cascade={"persist", "remove"})
  31. */
  32. protected $solutions;
  33. /**
  34. * @ORM\Column(type="string", length=256, nullable=true)
  35. */
  36. protected $videoLink;
  37. /**
  38. * @ORM\Column(type="string", length=180, nullable=true)
  39. */
  40. protected $emailContact;
  41. /**
  42. * @ORM\Column(type="string", length=256, nullable=true)
  43. */
  44. protected $website;
  45. public function __construct()
  46. {
  47. $this->entries = new ArrayCollection();
  48. }
  49. public function __toString()
  50. {
  51. return $this->getTitle();
  52. }
  53. public function getWorkshopThematic(): ?WorkshopThematicInterface
  54. {
  55. return $this->workshopThematic;
  56. }
  57. public function setWorkshopThematic(WorkshopThematicInterface $workshopThematic): self
  58. {
  59. $this->workshopThematic = $workshopThematic;
  60. return $this;
  61. }
  62. public function getType(): ?TypeInterface
  63. {
  64. return $this->type;
  65. }
  66. public function setType(TypeInterface $type): self
  67. {
  68. $this->type = $type;
  69. return $this;
  70. }
  71. /**
  72. * @return Collection|EntryInterface[]
  73. */
  74. public function getEntries(): Collection
  75. {
  76. return $this->entries;
  77. }
  78. public function addEntry(EntryInterface $entry): self
  79. {
  80. if (!$this->entries->contains($entry)) {
  81. $this->entries[] = $entry;
  82. }
  83. return $this;
  84. }
  85. public function removeEntry(EntryInterface $entry): self
  86. {
  87. if ($this->entries->contains($entry)) {
  88. $this->entries->removeElement($entry);
  89. }
  90. return $this;
  91. }
  92. public function getHook(): ?string
  93. {
  94. return $this->hook;
  95. }
  96. public function setHook(string $hook): self
  97. {
  98. $this->hook = $hook;
  99. return $this;
  100. }
  101. public function getVideoLink(): ?string
  102. {
  103. return $this->videoLink;
  104. }
  105. public function setVideoLink(?string $videoLink): self
  106. {
  107. $this->videoLink = $videoLink;
  108. return $this;
  109. }
  110. /**
  111. * @return Collection|SolutionInterface[]
  112. */
  113. public function getSolutions(): Collection
  114. {
  115. return $this->solutions;
  116. }
  117. public function addSolution(SolutionInterface $solution): self
  118. {
  119. if (!$this->solutions->contains($solution)) {
  120. $this->solutions[] = $solution;
  121. }
  122. return $this;
  123. }
  124. public function removeSolution(SolutionInterface $solution): self
  125. {
  126. if ($this->solutions->contains($solution)) {
  127. $this->solutions->removeElement($solution);
  128. }
  129. return $this;
  130. }
  131. public function getEmailContact(): ?string
  132. {
  133. return $this->emailContact;
  134. }
  135. public function setEmailContact(string $emailContact): self
  136. {
  137. $this->emailContact = $emailContact;
  138. return $this;
  139. }
  140. public function getWebsite(): ?string
  141. {
  142. return $this->website;
  143. }
  144. public function setWebsite(string $website): self
  145. {
  146. $this->website = $website;
  147. return $this;
  148. }
  149. }