|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- <?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\Extension\ImageTrait;
- use Lc\SovBundle\Doctrine\Pattern\AbstractFullEntity;
- use Lc\SovBundle\Model\File\FileInterface;
-
- /**
- * @ORM\MappedSuperclass()
- */
- abstract class WorkshopThematic extends AbstractFullEntity implements WorkshopThematicInterface, EntityInterface
- {
- use ImageTrait;
-
- /**
- * @ORM\OneToMany(targetEntity="Lc\PietroBundle\Model\Workshop\WorkshopInterface", mappedBy="workshopThematic", cascade={"persist", "remove"}, fetch="EAGER")
- * @ORM\OrderBy({"position" = "ASC"})
- */
- protected $workshops;
-
- /**
- * @ORM\Column(type="string", length=255, nullable=true)
- */
- protected $color;
-
- 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 getColor(): ?string
- {
- return $this->color;
- }
-
- public function setColor(?string $color): self
- {
- $this->color = $color;
-
- return $this;
- }
- }
|