|
- <?php
-
- namespace Lc\PietroBundle\Model\Workshop;
-
- use Doctrine\Common\Collections\ArrayCollection;
- use Doctrine\Common\Collections\Collection;
- use Doctrine\ORM\Mapping as ORM;
- use Lc\SovBundle\Doctrine\EntityInterface;
- use Lc\SovBundle\Doctrine\Pattern\AbstractFullEntity;
-
- /**
- * @ORM\MappedSuperclass()
- */
- abstract class Workshop extends AbstractFullEntity implements WorkshopInterface, EntityInterface
- {
- /**
- * @ORM\ManyToOne(targetEntity="Lc\PietroBundle\Model\Workshop\WorkshopThematicInterface", inversedBy="workshops")
- */
- protected $workshopThematic;
-
- /**
- * @ORM\ManyToOne(targetEntity="Lc\PietroBundle\Model\Workshop\TypeInterface", inversedBy="workshops")
- */
- protected $type;
-
- /**
- * @ORM\OneToMany(targetEntity="Lc\PietroBundle\Model\Workshop\EntryInterface", mappedBy="workshop", cascade={"persist", "remove"})
- */
- protected $entries;
-
- public function __construct()
- {
- $this->entries = new ArrayCollection();
- }
-
- public function __toString()
- {
- return $this->getTitle();
- }
-
- public function getWorkshopThematic(): ?WorkshopThematicInterface
- {
- return $this->workshopThematic;
- }
-
- public function setWorkshopThematic(WorkshopThematicInterface $workshopThematic): self
- {
- $this->workshopThematic = $workshopThematic;
-
- return $this;
- }
-
- public function getType(): ?TypeInterface
- {
- return $this->type;
- }
-
- public function setType(TypeInterface $type): self
- {
- $this->type = $type;
-
- return $this;
- }
-
- /**
- * @return Collection|EntryInterface[]
- */
- public function getEntries(): Collection
- {
- return $this->entries;
- }
-
- public function addEntry(EntryInterface $entry): self
- {
- if (!$this->entries->contains($entry)) {
- $this->entries[] = $entry;
- }
-
- return $this;
- }
-
- public function removeEntry(EntryInterface $entry): self
- {
- if ($this->entries->contains($entry)) {
- $this->entries->removeElement($entry);
- }
-
- return $this;
- }
- }
|