|
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- <?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;
- use Lc\SovBundle\Model\File\FileInterface;
-
- /**
- * @ORM\MappedSuperclass()
- */
- abstract class WorkshopThematic extends AbstractFullEntity implements WorkshopThematicInterface, EntityInterface
- {
- /**
- * @ORM\OneToMany(targetEntity="Lc\PietroBundle\Model\Workshop\WorkshopInterface", mappedBy="thematic", cascade={"persist", "remove"})
- */
- protected $workshops;
-
- /**
- * @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\File\FileInterface", cascade={"persist", "remove"})
- */
- protected $image;
-
- public function __construct()
- {
- $this->workshops = new ArrayCollection();
- }
-
- public function __toString()
- {
- return $this->getTitle();
- }
-
- /**
- * @return Collection|WorkshopInterface[]
- */
- public function getWorkshops(): Collection
- {
- return $this->workshops;
- }
-
- public function addWorkshop(WorkshopInterface $workshop): self
- {
- if (!$this->workshops->contains($workshop)) {
- $this->workshops[] = $workshop;
- }
-
- return $this;
- }
-
- public function removeWorkshop(WorkshopInterface $workshop): self
- {
- if ($this->workshops->contains($workshop)) {
- $this->workshops->removeElement($workshop);
- }
-
- return $this;
- }
-
- public function getImage(): ?FileInterface
- {
- return $this->image;
- }
-
- public function setImage(?FileInterface $image): self
- {
- $this->image = $image;
-
- return $this;
- }
- }
|