<?php
namespace App\Entity;
use App\Repository\ServiceRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=ServiceRepository::class)
*/
class Service
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $name;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $description;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $status;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $image;
/**
* @ORM\Column(type="datetime_immutable", nullable=true)
*/
private $createdAt;
/**
* @ORM\ManyToOne(targetEntity=CategoryServices::class, inversedBy="services")
*/
private $categoryService;
/**
* @ORM\OneToMany(targetEntity=Portfolio::class, mappedBy="service")
*/
private $portfolios;
/**
* @ORM\OneToMany(targetEntity=Reservation::class, mappedBy="service")
*/
private $reservations;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $slug;
/**
* @ORM\OneToMany(targetEntity=Album::class, mappedBy="service")
*/
private $albums;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $slogan;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $cover;
public function __construct()
{
$this->portfolios = new ArrayCollection();
$this->reservations = new ArrayCollection();
$this->albums = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(?string $name): self
{
$this->name = $name;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
public function isStatus(): ?bool
{
return $this->status;
}
public function setStatus(?bool $status): self
{
$this->status = $status;
return $this;
}
public function getImage(): ?string
{
return $this->image;
}
public function setImage(?string $image): self
{
$this->image = $image;
return $this;
}
public function getCreatedAt(): ?\DateTimeImmutable
{
return $this->createdAt;
}
public function setCreatedAt(?\DateTimeImmutable $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function getCategoryService(): ?CategoryServices
{
return $this->categoryService;
}
public function setCategoryService(?CategoryServices $categoryService): self
{
$this->categoryService = $categoryService;
return $this;
}
/**
* @return Collection<int, Portfolio>
*/
public function getPortfolios(): Collection
{
return $this->portfolios;
}
public function addPortfolio(Portfolio $portfolio): self
{
if (!$this->portfolios->contains($portfolio)) {
$this->portfolios[] = $portfolio;
$portfolio->setService($this);
}
return $this;
}
public function removePortfolio(Portfolio $portfolio): self
{
if ($this->portfolios->removeElement($portfolio)) {
// set the owning side to null (unless already changed)
if ($portfolio->getService() === $this) {
$portfolio->setService(null);
}
}
return $this;
}
/**
* @return Collection<int, Reservation>
*/
public function getReservations(): Collection
{
return $this->reservations;
}
public function addReservation(Reservation $reservation): self
{
if (!$this->reservations->contains($reservation)) {
$this->reservations[] = $reservation;
$reservation->setService($this);
}
return $this;
}
public function removeReservation(Reservation $reservation): self
{
if ($this->reservations->removeElement($reservation)) {
// set the owning side to null (unless already changed)
if ($reservation->getService() === $this) {
$reservation->setService(null);
}
}
return $this;
}
public function getSlug(): ?string
{
return $this->slug;
}
public function setSlug(?string $slug): self
{
$this->slug = $slug;
return $this;
}
/**
* @return Collection<int, Album>
*/
public function getAlbums(): Collection
{
return $this->albums;
}
public function addAlbum(Album $album): self
{
if (!$this->albums->contains($album)) {
$this->albums[] = $album;
$album->setService($this);
}
return $this;
}
public function removeAlbum(Album $album): self
{
if ($this->albums->removeElement($album)) {
// set the owning side to null (unless already changed)
if ($album->getService() === $this) {
$album->setService(null);
}
}
return $this;
}
public function getSlogan(): ?string
{
return $this->slogan;
}
public function setSlogan(?string $slogan): self
{
$this->slogan = $slogan;
return $this;
}
public function getCover(): ?string
{
return $this->cover;
}
public function setCover(?string $cover): self
{
$this->cover = $cover;
return $this;
}
public function __toString(): string
{
return $this->name ?: 'Album';
}
}