suivi/src/Entity/Conference.php
2022-12-19 18:35:10 +01:00

177 lines
3.5 KiB
PHP

<?php
namespace App\Entity;
use App\Core\Entity\EntityInterface;
use App\Repository\ConferenceRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: ConferenceRepository::class)]
class Conference implements EntityInterface
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
protected $id;
#[ORM\Column(type: 'string', length: 255)]
protected $label;
#[ORM\Column(type: 'integer')]
protected $persons;
#[ORM\ManyToOne(targetEntity: ThemeType::class, inversedBy: 'conferences', cascade: ['persist', 'remove'])]
#[ORM\JoinColumn(nullable: false)]
protected $themeType;
#[ORM\Column(type: 'text', nullable: true)]
protected $content;
#[ORM\Column(type: 'text', nullable: true)]
protected $comment;
#[ORM\Column(type: 'text', nullable: true)]
protected $feedback;
#[ORM\Column(type: 'date', nullable: true)]
protected $date;
#[ORM\Column(type: 'float', nullable: true)]
protected $price;
#[ORM\ManyToMany(targetEntity: Speaker::class, inversedBy: 'conferences')]
protected $speakers;
public function __construct()
{
$this->speakers = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getLabel(): ?string
{
return $this->label;
}
public function setLabel(string $label): self
{
$this->label = $label;
return $this;
}
public function getPersons(): ?int
{
return $this->persons;
}
public function setPersons(int $persons): self
{
$this->persons = abs($persons);
return $this;
}
public function getThemeType(): ?ThemeType
{
return $this->themeType;
}
public function setThemeType(?ThemeType $themeType): self
{
$this->themeType = $themeType;
return $this;
}
public function getContent(): ?string
{
return $this->content;
}
public function setContent(?string $content): self
{
$this->content = $content;
return $this;
}
public function getComment(): ?string
{
return $this->comment;
}
public function setComment(?string $comment): self
{
$this->comment = $comment;
return $this;
}
public function getFeedback(): ?string
{
return $this->feedback;
}
public function setFeedback(?string $feedback): self
{
$this->feedback = $feedback;
return $this;
}
public function getDate(): ?\DateTimeInterface
{
return $this->date;
}
public function setDate(?\DateTimeInterface $date): self
{
$this->date = $date;
return $this;
}
public function getPrice(): ?float
{
return $this->price;
}
public function setPrice(?float $price): self
{
$this->price = $price;
return $this;
}
/**
* @return Collection<int, Speaker>
*/
public function getSpeakers(): Collection
{
return $this->speakers;
}
public function addSpeaker(Speaker $speaker): self
{
if (!$this->speakers->contains($speaker)) {
$this->speakers[] = $speaker;
}
return $this;
}
public function removeSpeaker(Speaker $speaker): self
{
$this->speakers->removeElement($speaker);
return $this;
}
}