<?php
namespace App\Application\Internit\AgendamentoBundle\Entity;
use App\Application\Internit\AgendamentoBundle\Repository\AgendamentoRepository;
use App\Application\Internit\OrdemServicoBundle\Entity\OrdemServico;
use App\Application\Internit\PeriodoAgendamentoBundle\Entity\PeriodoAgendamento;
use App\Application\Internit\AndamentoSolicitacaoBundle\Entity\AndamentoSolicitacao;
use App\Application\Internit\ProfissionalBundle\Entity\Profissional;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use Symfony\Component\Validator\Constraints as Assert;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use App\Entity\SonataMediaGallery;
use App\Entity\SonataMediaMedia;
use Doctrine\ORM\Mapping as ORM;
use DateTime;
/** Info: */
#[ORM\Table(name: 'agendamento')]
#[ORM\Entity(repositoryClass: AgendamentoRepository::class)]
#[UniqueEntity('id')]
class Agendamento
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(name: 'id', type: 'integer', unique: true, nullable: false)]
private ?int $id = null;
#[Assert\NotNull]
#[Assert\NotBlank]
#[Assert\Date]
#[ORM\Column(name: 'data', type: 'date', unique: false, nullable: false)]
private DateTime $data;
#[ORM\Column(name: 'hora', type: 'time', unique: false, nullable: false)]
private DateTime $hora;
#[Assert\NotNull]
#[Assert\NotBlank]
#[ORM\Column(name: 'observacoes', type: 'text', unique: false, nullable: false)]
private string $observacoes;
#[ORM\OneToOne(mappedBy: 'agendamento', targetEntity: AndamentoSolicitacao::class)]
private $andamento;
#[ORM\JoinTable(name: 'profissional_agendamento')]
#[ORM\JoinColumn(name: 'agendamento_id', referencedColumnName: 'id')] // , onDelete: 'SET NULL'
#[ORM\InverseJoinColumn(name: 'profissional_id', referencedColumnName: 'id')]
#[ORM\ManyToMany(targetEntity: Profissional::class, inversedBy: 'agendamentos')]
private Collection $profissionais;
#[ORM\OneToMany(mappedBy: 'agendamento', targetEntity: OrdemServico::class)]
private Collection $ordemServicos;
#[ORM\ManyToOne(targetEntity: SonataMediaGallery::class, cascade: ['persist'])]
private mixed $anexos;
public function __construct()
{
$this->profissionais = new ArrayCollection();
$this->ordemServicos = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getData(): DateTime
{
return $this->data;
}
public function setData(DateTime $data): void
{
$this->data = $data;
}
public function getObservacoes(): string
{
return $this->observacoes;
}
public function setObservacoes(string $observacoes): void
{
$this->observacoes = $observacoes;
}
public function getHora(): DateTime
{
return $this->hora;
}
public function setHora(DateTime $hora): void
{
$this->hora = $hora;
}
public function getAndamento()
{
return $this->andamento;
}
public function setAndamento( $andamento): void
{
$this->andamento = $andamento;
}
public function getProfissionais(): Collection
{
return $this->profissionais;
}
public function setProfissionais(Collection $profissionais): void
{
$this->profissionais = $profissionais;
}
public function getOrdemServicos(): Collection
{
return $this->ordemServicos;
}
public function setOrdemServicos(Collection $ordemServicos): void
{
$this->ordemServicos = $ordemServicos;
}
public function getAnexos(): mixed
{
return $this->anexos;
}
public function setAnexos(mixed $anexos): void
{
$this->anexos = $anexos;
}
}