<?php
namespace App\Entity;
use App\Entity\Category;
use Doctrine\ORM\Mapping as ORM;
use App\Repository\ServiceRepository;
use Doctrine\Common\Collections\Collection;
use Doctrine\Common\Collections\ArrayCollection;
/**
* @ORM\Entity(repositoryClass=ServiceRepository::class)
*/
class Service
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity=Category::class, inversedBy="services")
* @ORM\JoinColumn(nullable=false)
*/
private $category;
/**
* @ORM\Column(type="string", length=255)
*/
private $title;
/**
* @ORM\OneToMany(targetEntity=User::class, mappedBy="service")
*/
private $users;
/**
* @ORM\Column(type="string", length=255)
*/
private $subtitle;
/**
* @ORM\Column(type="text")
*/
private $content;
/**
* @ORM\Column(type="text")
*/
private $price;
/**
* @ORM\Column(type="string", length=255)
*/
private $picture;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $created_At;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $updated_At;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $deleted_At;
/**
* @ORM\OneToMany(targetEntity=Commentary::class, mappedBy="service")
*/
private $commentaries;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $target;
/**
* @ORM\Column(type="float", nullable=true)
*/
private $sessionmin;
/**
* @ORM\Column(type="float", nullable=true)
*/
private $sessionmax;
/**
* @ORM\Column(type="float", nullable=true)
*/
private $duration;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $rythm;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $modality;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $progress;
public function __construct()
{
$this->users = new ArrayCollection();
$this->commentaries = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getCategory(): ?Category
{
return $this->category;
}
public function setCategory(?Category $category): self
{
$this->category = $category;
return $this;
}
public function getTitle(): ?string
{
return $this->title;
}
public function setTitle(string $title): self
{
$this->title = $title;
return $this;
}
/**
* @return Collection<int, User>
*/
public function getUsers(): Collection
{
return $this->users;
}
public function addUser(User $user): self
{
if (!$this->users->contains($user)) {
$this->users[] = $user;
$user->setService($this);
}
return $this;
}
public function removeUser(User $user): self
{
if ($this->users->removeElement($user)) {
// set the owning side to null (unless already changed)
if ($user->getService() === $this) {
$user->setService(null);
}
}
return $this;
}
public function getSubtitle(): ?string
{
return $this->subtitle;
}
public function setSubtitle(string $subtitle): self
{
$this->subtitle = $subtitle;
return $this;
}
public function getContent(): ?string
{
return $this->content;
}
public function setContent(string $content): self
{
$this->content = $content;
return $this;
}
public function getPrice(): ?string
{
return $this->price;
}
public function setPrice(string $price): self
{
$this->price = $price;
return $this;
}
public function getPicture(): ?string
{
return $this->picture;
}
public function setPicture(string $picture): self
{
$this->picture = $picture;
return $this;
}
public function __toString()
{
return $this->title;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->created_At;
}
public function setCreatedAt(\DateTimeInterface $created_At): self
{
$this->created_At = $created_At;
return $this;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updated_At;
}
public function setUpdatedAt(\DateTimeInterface $updated_At): self
{
$this->updated_At = $updated_At;
return $this;
}
public function getDeletedAt(): ?\DateTimeInterface
{
return $this->deleted_At;
}
public function setDeletedAt(?\DateTimeInterface $deleted_At): self
{
$this->deleted_At = $deleted_At;
return $this;
}
/**
* @return Collection<int, Commentary>
*/
public function getCommentaries(): Collection
{
return $this->commentaries;
}
public function addCommentary(Commentary $commentary): self
{
if (!$this->commentaries->contains($commentary)) {
$this->commentaries[] = $commentary;
$commentary->setService($this);
}
return $this;
}
public function removeCommentary(Commentary $commentary): self
{
if ($this->commentaries->removeElement($commentary)) {
// set the owning side to null (unless already changed)
if ($commentary->getService() === $this) {
$commentary->setService(null);
}
}
return $this;
}
public function getTarget(): ?string
{
return $this->target;
}
public function setTarget(?string $target): self
{
$this->target = $target;
return $this;
}
public function getSessionmin(): ?float
{
return $this->sessionmin;
}
public function setSessionmin(?float $sessionmin): self
{
$this->sessionmin = $sessionmin;
return $this;
}
public function getSessionmax(): ?float
{
return $this->sessionmax;
}
public function setSessionmax(?float $sessionmax): self
{
$this->sessionmax = $sessionmax;
return $this;
}
public function getDuration(): ?float
{
return $this->duration;
}
public function setDuration(?float $duration): self
{
$this->duration = $duration;
return $this;
}
public function getRythm(): ?string
{
return $this->rythm;
}
public function setRythm(?string $rythm): self
{
$this->rythm = $rythm;
return $this;
}
public function getModality(): ?string
{
return $this->modality;
}
public function setModality(?string $modality): self
{
$this->modality = $modality;
return $this;
}
public function getProgress(): ?string
{
return $this->progress;
}
public function setProgress(?string $progress): self
{
$this->progress = $progress;
return $this;
}
}