Employee
in package
Salarié d'une entreprise cliente, pouvant recevoir sa propre carte de visite virtuelle.
Un employé appartient à une entreprise unique Company (jointure obligatoire) et porte
au plus une carte de visite virtuelle BusinessCardAize (relation OneToOne inverse,
avec cascade persist/remove : supprimer l'employé supprime sa carte). L'unicité de
email et de phone est contrôlée à la fois en base (UNIQ_IDENTIFIER_EMAIL) et au niveau
applicatif (#[UniqueEntity]). getFullName() est un champ dérivé qui concatène firstName
et lastName, sans être persisté. isActive (par défaut true) permet de désactiver un
employé sans le supprimer.
Attributes
- #[Entity]
- $repositoryClass: \App\Repository\EmployeeRepository::class
- #[UniqueConstraint]
- $name: 'UNIQ_IDENTIFIER_EMAIL'
- $fields: ['email', 'phone']
- #[UniqueEntity]
- $fields: ['email']
- $message: 'Un employé existe dejà avec cet email'
- #[UniqueEntity]
- $fields: ['phone']
- $message: 'Un employé existe dejà avec cet numéro de téléphone'
Table of Contents
Properties
- $businessCard : BusinessCardAize|null
- $company : Company|null
- $createdAt : DateTimeImmutable|null
- $cvPath : string|null
- $department : string|null
- $email : string|null
- $firstName : string|null
- $id : int|null
- $isActive : bool
- $lastName : string|null
- $phone : string|null
- $position : string|null
Methods
- __construct() : mixed
- getBusinessCard() : BusinessCardAize|null
- getCompany() : Company|null
- getCreatedAt() : DateTimeImmutable|null
- getCvPath() : string|null
- getDepartment() : string|null
- getEmail() : string|null
- getFirstName() : string|null
- getFullName() : string
- getId() : int|null
- getLastName() : string|null
- getPhone() : string|null
- getPosition() : string|null
- isActive() : bool
- setActive() : static
- setBusinessCard() : static
- setCompany() : static
- setCreatedAt() : static
- setCvPath() : static
- setDepartment() : static
- setEmail() : static
- setFirstName() : static
- setLastName() : static
- setPhone() : static
- setPosition() : static
Properties
$businessCard
private
BusinessCardAize|null
$businessCard
= null
Attributes
- #[OneToOne]
- $mappedBy: 'employee'
- $cascade: ['persist', 'remove']
$company
private
Company|null
$company
= null
Attributes
- #[JoinColumn]
- $nullable: false
- #[ManyToOne]
- $inversedBy: 'employees'
$createdAt
private
DateTimeImmutable|null
$createdAt
Attributes
- #[Column]
$cvPath
private
string|null
$cvPath
= null
Attributes
- #[Column]
- $length: 255
- $nullable: true
$department
private
string|null
$department
= null
Attributes
- #[Column]
- $length: 100
- $nullable: true
private
string|null
$email
= null
Attributes
- #[Column]
- $length: 180
- #[Email]
- $message: 'Veuillez entrer un email valide'
- #[NotBlank]
- $message: 'L\'email est obligatoire'
$firstName
private
string|null
$firstName
= null
Attributes
- #[Column]
- $length: 100
- #[Length]
- $min: 2
- $max: 100
- #[NotBlank]
- $message: 'Le prénom est obligatoire'
$id
private
int|null
$id
= null
Attributes
- #[Column]
- #[GeneratedValue]
- #[Id]
$isActive
private
bool
$isActive
= true
Attributes
- #[Column]
$lastName
private
string|null
$lastName
= null
Attributes
- #[Column]
- $length: 100
- #[Length]
- $min: 2
- $max: 100
- #[NotBlank]
- $message: 'Le nom est obligatoire'
$phone
private
string|null
$phone
= null
Attributes
- #[Column]
- $length: 20
- $nullable: true
$position
private
string|null
$position
= null
Attributes
- #[Column]
- $length: 100
- $nullable: true
Methods
__construct()
public
__construct() : mixed
getBusinessCard()
public
getBusinessCard() : BusinessCardAize|null
Return values
BusinessCardAize|nullgetCompany()
public
getCompany() : Company|null
Return values
Company|nullgetCreatedAt()
public
getCreatedAt() : DateTimeImmutable|null
Return values
DateTimeImmutable|nullgetCvPath()
public
getCvPath() : string|null
Return values
string|nullgetDepartment()
public
getDepartment() : string|null
Return values
string|nullgetEmail()
public
getEmail() : string|null
Return values
string|nullgetFirstName()
public
getFirstName() : string|null
Return values
string|nullgetFullName()
public
getFullName() : string
Return values
stringgetId()
public
getId() : int|null
Return values
int|nullgetLastName()
public
getLastName() : string|null
Return values
string|nullgetPhone()
public
getPhone() : string|null
Return values
string|nullgetPosition()
public
getPosition() : string|null
Return values
string|nullisActive()
public
isActive() : bool
Return values
boolsetActive()
public
setActive(bool $isActive) : static
Parameters
- $isActive : bool
Return values
staticsetBusinessCard()
public
setBusinessCard(BusinessCardAize|null $businessCard) : static
Parameters
- $businessCard : BusinessCardAize|null
Return values
staticsetCompany()
public
setCompany(Company|null $company) : static
Parameters
- $company : Company|null
Return values
staticsetCreatedAt()
public
setCreatedAt(DateTimeImmutable $createdAt) : static
Parameters
- $createdAt : DateTimeImmutable
Return values
staticsetCvPath()
public
setCvPath(string|null $cvPath) : static
Parameters
- $cvPath : string|null
Return values
staticsetDepartment()
public
setDepartment(string|null $department) : static
Parameters
- $department : string|null
Return values
staticsetEmail()
public
setEmail(string $email) : static
Parameters
- $email : string
Return values
staticsetFirstName()
public
setFirstName(string $firstName) : static
Parameters
- $firstName : string
Return values
staticsetLastName()
public
setLastName(string $lastName) : static
Parameters
- $lastName : string
Return values
staticsetPhone()
public
setPhone(string|null $phone) : static
Parameters
- $phone : string|null
Return values
staticsetPosition()
public
setPosition(string|null $position) : static
Parameters
- $position : string|null