src/Application/Internit/ProfissionalBundle/Entity/Profissional.php line 23

Open in your IDE?
  1. <?php
  2. namespace App\Application\Internit\ProfissionalBundle\Entity;
  3. use App\Application\Internit\OrdemServicoBundle\Entity\OrdemServico;
  4. use App\Application\Internit\ProfissionalBundle\Repository\ProfissionalRepository;
  5. use App\Application\Internit\ProfissaoBundle\Entity\Profissao;
  6. use App\Application\Internit\AgendamentoBundle\Entity\Agendamento;
  7. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  8. use Symfony\Component\Validator\Constraints as Assert;
  9. use Doctrine\Common\Collections\ArrayCollection;
  10. use Doctrine\Common\Collections\Collection;
  11. use App\Entity\SonataMediaGallery;
  12. use App\Entity\SonataMediaMedia;
  13. use Doctrine\ORM\Mapping as ORM;
  14. use DateTime;
  15. /** Info:  */
  16. #[ORM\Table(name'profissional')]
  17. #[ORM\Entity(repositoryClassProfissionalRepository::class)]
  18. #[UniqueEntity('id')]
  19. class Profissional
  20. {
  21.     #[ORM\Id]
  22.     #[ORM\GeneratedValue]
  23.     #[ORM\Column(name'id'type'integer'uniquetruenullablefalse)]
  24.     private ?int $id null;
  25.     #[ORM\ManyToOne(targetEntitySonataMediaMedia::class, cascade: ['persist'])]
  26.     private mixed $logo;
  27.     #[Assert\NotNull]
  28.     #[Assert\NotBlank]
  29.     #[ORM\Column(name'nomeCompleto'type'string'uniquefalsenullablefalse)]
  30.     private string $nomeCompleto;
  31.     #[Assert\NotNull]
  32.     #[Assert\NotBlank]
  33.     #[ORM\Column(name'email'type'string'uniquefalsenullablefalse)]
  34.     private string $email;
  35.     #[Assert\NotNull]
  36.     #[Assert\NotBlank]
  37.     #[ORM\Column(name'telefone1'type'string'uniquefalsenullablefalse)]
  38.     private string $telefone1;
  39.     #[ORM\Column(name'telefone2'type'string'uniquefalsenullabletrue)]
  40.     private ?string $telefone2 null;
  41.     #[ORM\Column(name'url'type'string'uniquefalsenullabletrue)]
  42.     private ?string $url null;
  43.     #[ORM\JoinTable(name'profissao_profissional')]
  44.     #[ORM\JoinColumn(name'profissional_id'referencedColumnName'id'onDelete'CASCADE')] // , onDelete: 'SET NULL'
  45.     #[ORM\InverseJoinColumn(name'profissao_id'referencedColumnName'id')]
  46.     #[ORM\ManyToMany(targetEntityProfissao::class)]
  47.     private Collection $profissoes;
  48.     #[ORM\ManyToMany(targetEntityAgendamento::class, mappedBy'profissionais')]
  49.     private Collection $agendamentos;
  50.     #[ORM\OneToMany(targetEntityOrdemServico::class, mappedBy'profissional')]
  51.     private Collection $ordemServicos;
  52.     private int $qtdOrdemServico;
  53.     public function __construct()
  54.     {
  55.         $this->ordemServicos = new ArrayCollection();
  56.         $this->profissoes = new ArrayCollection();
  57.         $this->agendamentos = new ArrayCollection();
  58.     }
  59.     public function getId(): ?int
  60.     {
  61.         return $this->id;
  62.     }
  63.     public function getNomecompleto(): string
  64.     {
  65.         return $this->nomeCompleto;
  66.     }
  67.     public function setNomecompleto(string $nomeCompleto): void
  68.     {
  69.         $this->nomeCompleto $nomeCompleto;
  70.     }
  71.     public function getEmail(): string
  72.     {
  73.         return $this->email;
  74.     }
  75.     public function setEmail(string $email): void
  76.     {
  77.         $this->email $email;
  78.     }
  79.     public function getTelefone1(): string
  80.     {
  81.         return $this->telefone1;
  82.     }
  83.     public function setTelefone1(string $telefone1): void
  84.     {
  85.         $this->telefone1 $telefone1;
  86.     }
  87.     public function getTelefone2(): ?string
  88.     {
  89.         return $this->telefone2;
  90.     }
  91.     public function setTelefone2(?string $telefone2): void
  92.     {
  93.         $this->telefone2 $telefone2;
  94.     }
  95.     public function getProfissoes(): Collection
  96.     {
  97.         return $this->profissoes;
  98.     }
  99.     public function setProfissoes(Collection $profissoes): void
  100.     {
  101.         $this->profissoes $profissoes;
  102.     }
  103.     public function getAgendamentos(): Collection
  104.     {
  105.         return $this->agendamentos;
  106.     }
  107.     public function setAgendamentos(Collection $agendamentos): void
  108.     {
  109.         $this->agendamentos $agendamentos;
  110.     }
  111.     public function getOrdemServicos(): Collection
  112.     {
  113.         return $this->ordemServicos;
  114.     }
  115.     public function setOrdemServicos(Collection $ordemServicos): void
  116.     {
  117.         $this->ordemServicos $ordemServicos;
  118.     }
  119.     public function getUrl(): ?string
  120.     {
  121.         return $this->url;
  122.     }
  123.     public function setUrl(?string $url): void
  124.     {
  125.         $this->url $url;
  126.     }
  127.     public function getLogo(): mixed
  128.     {
  129.         return $this->logo;
  130.     }
  131.     public function setLogo(mixed $logo): void
  132.     {
  133.         $this->logo $logo;
  134.     }
  135.     public function getQtdOrdemServico(): int
  136.     {
  137.         return count($this->getOrdemServicos());
  138.     }
  139.     public function setQtdOrdemServico(int $qtdOrdemServico): void
  140.     {
  141.         $this->qtdOrdemServico $qtdOrdemServico;
  142.     }
  143. }