<?php
namespace App\Entity;
use App\Repository\Actuv2ElectronicInvoiceRepository;
use DateTimeInterface;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: Actuv2ElectronicInvoiceRepository::class)]
class Actuv2ElectronicInvoice
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\Column(name: 'date', type: 'date', nullable: true, options: ['comment' => 'période'])]
private $date;
#[ORM\Column(name: 'question', type: 'text', nullable: false)]
private $question;
#[ORM\Column(name: 'detail', type: 'text', nullable: false)]
private $detail;
#[ORM\Column(type: 'datetime', nullable: true)]
private $updatedAt;
#[ORM\OneToMany(mappedBy: 'electronicInvoice', targetEntity: Actuv2ElectronicInvoiceVote::class)]
private $actuv2ElectronicInvoiceVotes;
#[ORM\OneToMany(mappedBy: 'actuv2ElectronicInvoice', targetEntity: Actuv2ElectronicInvoiceAnswer::class, cascade: ['persist', 'remove'], orphanRemoval: true)]
private $answers;
public function __construct()
{
$this->actuv2ElectronicInvoiceVotes = new ArrayCollection();
$this->answers = new ArrayCollection();
}
public function getId(): ?string
{
return $this->id;
}
public function getDate(): ?DateTimeInterface
{
return $this->date;
}
public function setDate(?DateTimeInterface $date): self
{
$this->date = $date;
return $this;
}
public function getUpdatedAt(): ?DateTimeInterface
{
return $this->updatedAt;
}
public function setUpdatedAt(?DateTimeInterface $updatedAt): self
{
$this->updatedAt = $updatedAt;
return $this;
}
public function getQuestion(): ?string
{
return $this->question;
}
public function setQuestion(?string $question): self
{
$this->question = $question;
return $this;
}
public function getDetail(): ?string
{
return $this->detail;
}
public function setDetail(?string $detail): self
{
$this->detail = $detail;
return $this;
}
/**
* @return Collection<int, Actuv2ElectronicInvoiceVote>
*/
public function getActuv2ElectronicInvoiceVotes(): Collection
{
return $this->actuv2ElectronicInvoiceVotes;
}
public function addActuv2ElectronicInvoiceVote(Actuv2ElectronicInvoiceVote $actuv2ElectronicInvoiceVote): self
{
if (!$this->actuv2ElectronicInvoiceVotes->contains($actuv2ElectronicInvoiceVote)) {
$this->actuv2ElectronicInvoiceVotes[] = $actuv2ElectronicInvoiceVote;
$actuv2ElectronicInvoiceVote->setElectronicInvoice($this);
}
return $this;
}
public function removeActuv2ElectronicInvoiceVote(Actuv2ElectronicInvoiceVote $actuv2ElectronicInvoiceVote): self
{
if ($this->actuv2ElectronicInvoiceVotes->removeElement($actuv2ElectronicInvoiceVote)) {
// set the owning side to null (unless already changed)
if ($actuv2ElectronicInvoiceVote->getElectronicInvoice() === $this) {
$actuv2ElectronicInvoiceVote->setElectronicInvoice(null);
}
}
return $this;
}
/**
* @return Collection<int, Actuv2ElectronicInvoiceAnswer>
*/
public function getAnswers(): Collection
{
return $this->answers;
}
public function addAnswer(Actuv2ElectronicInvoiceAnswer $answer): self
{
if (!$this->answers->contains($answer)) {
$this->answers[] = $answer;
$answer->setActuv2ElectronicInvoice($this);
}
return $this;
}
public function removeAnswer(Actuv2ElectronicInvoiceAnswer $answer): self
{
if ($this->answers->removeElement($answer)) {
// set the owning side to null (unless already changed)
if ($answer->getActuv2ElectronicInvoice() === $this) {
$answer->setActuv2ElectronicInvoice(null);
}
}
return $this;
}
}