<?php
namespace App\Entity;
use App\Repository\EmployeeRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity(repositoryClass=EmployeeRepository::class)
*/
class Employee extends EntityBase
{
/**
* @Groups("api")
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\OneToOne(targetEntity=Partner::class, inversedBy="employee", cascade={"persist", "remove"})
* @ORM\JoinColumn(nullable=false)
*/
private $partner;
/**
* @Groups("api")
* @ORM\Column(type="string", length=255)
* @Assert\NotBlank(groups="creationEmployee")
*/
private $lastName;
/**
* @Groups("api")
* @ORM\Column(type="string", length=255)
* @Assert\NotBlank(groups="creationEmployee")
*/
private $firstName;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Assert\NotBlank(groups="creationEmployee")
*/
private $personalPhone;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Assert\NotBlank(groups="creationEmployee")
*/
private $email;
/**
* @ORM\Column(type="string", length=255)
* @Assert\NotBlank(groups="creationEmployee")
*/
private $sexe;
/**
* @ORM\ManyToOne(targetEntity=ResListeDeChoix::class)
* @ORM\JoinColumn(nullable=true)
* @Assert\NotBlank(groups="creationEmployee")
*/
private $type;
/**
* @ORM\ManyToOne(targetEntity=PosteDirector::class, inversedBy="employees")
*/
private $posteDirector;
public function getId(): ?int
{
return $this->id;
}
public function getPartner(): ?Partner
{
return $this->partner;
}
public function setPartner(Partner $partner): self
{
$this->partner = $partner;
return $this;
}
public function getLastName(): ?string
{
return $this->lastName;
}
public function setLastName(string $lastName): self
{
$this->lastName = $lastName;
return $this;
}
public function getFirstName(): ?string
{
return $this->firstName;
}
public function setFirstName(string $firstName): self
{
$this->firstName = $firstName;
return $this;
}
public function getPersonalPhone(): ?string
{
return $this->personalPhone;
}
public function setPersonalPhone(?string $personalPhone): self
{
$this->personalPhone = $personalPhone;
return $this;
}
public function getEmail(): ?string
{
return $this->email;
}
public function setEmail(?string $email): self
{
$this->email = $email;
return $this;
}
public function getSexe(): ?string
{
return $this->sexe;
}
public function setSexe(string $sexe): self
{
$this->sexe = $sexe;
return $this;
}
public function getType(): ?ResListeDeChoix
{
return $this->type;
}
public function setType(?ResListeDeChoix $type): self
{
$this->type = $type;
return $this;
}
public function getFullName()
{
return $this->firstName . " " . $this->lastName;
}
public function getPosteDirector(): ?PosteDirector
{
return $this->posteDirector;
}
public function setPosteDirector(?PosteDirector $posteDirector): self
{
$this->posteDirector = $posteDirector;
return $this;
}
}