<?php
namespace App\Entity;
use App\Repository\PageBlockCarouselRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=PageBlockCarouselRepository::class)
*/
class PageBlockCarousel
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\OneToMany(targetEntity=PageBlockCarouselItem::class, mappedBy="pageBlockCarousel", orphanRemoval=true, cascade={"persist", "remove"})
*/
private $items;
public function __construct()
{
$this->items = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
/**
* @return Collection|PageBlockCarouselItem[]
*/
public function getItems(): Collection
{
return $this->items;
}
public function addItem(PageBlockCarouselItem $item): self
{
if (!$this->items->contains($item)) {
$this->items[] = $item;
$item->setPageBlockCarousel($this);
}
return $this;
}
public function removeItem(PageBlockCarouselItem $item): self
{
if ($this->items->removeElement($item)) {
// set the owning side to null (unless already changed)
if ($item->getPageBlockCarousel() === $this) {
$item->setPageBlockCarousel(null);
}
}
return $this;
}
public function __toString(): string
{
return '';
}
}