You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

156 lines
3.4KB

  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. public function __construct()
  38. {
  39. $this->entries = new ArrayCollection();
  40. }
  41. public function __toString()
  42. {
  43. return $this->getTitle();
  44. }
  45. public function getWorkshopThematic(): ?WorkshopThematicInterface
  46. {
  47. return $this->workshopThematic;
  48. }
  49. public function setWorkshopThematic(WorkshopThematicInterface $workshopThematic): self
  50. {
  51. $this->workshopThematic = $workshopThematic;
  52. return $this;
  53. }
  54. public function getType(): ?TypeInterface
  55. {
  56. return $this->type;
  57. }
  58. public function setType(TypeInterface $type): self
  59. {
  60. $this->type = $type;
  61. return $this;
  62. }
  63. /**
  64. * @return Collection|EntryInterface[]
  65. */
  66. public function getEntries(): Collection
  67. {
  68. return $this->entries;
  69. }
  70. public function addEntry(EntryInterface $entry): self
  71. {
  72. if (!$this->entries->contains($entry)) {
  73. $this->entries[] = $entry;
  74. }
  75. return $this;
  76. }
  77. public function removeEntry(EntryInterface $entry): self
  78. {
  79. if ($this->entries->contains($entry)) {
  80. $this->entries->removeElement($entry);
  81. }
  82. return $this;
  83. }
  84. public function getHook(): ?string
  85. {
  86. return $this->hook;
  87. }
  88. public function setHook(string $hook): self
  89. {
  90. $this->hook = $hook;
  91. return $this;
  92. }
  93. public function getVideoLink(): ?string
  94. {
  95. return $this->videoLink;
  96. }
  97. public function setVideoLink(?string $videoLink): self
  98. {
  99. $this->videoLink = $videoLink;
  100. return $this;
  101. }
  102. /**
  103. * @return Collection|SolutionInterface[]
  104. */
  105. public function getSolutions(): Collection
  106. {
  107. return $this->solutions;
  108. }
  109. public function addSolution(SolutionInterface $solution): self
  110. {
  111. if (!$this->solutions->contains($solution)) {
  112. $this->solutions[] = $solution;
  113. }
  114. return $this;
  115. }
  116. public function removeSolution(SolutionInterface $solution): self
  117. {
  118. if ($this->solutions->contains($solution)) {
  119. $this->solutions->removeElement($solution);
  120. }
  121. return $this;
  122. }
  123. }