HegreLand/src/Entity/Employee.php

169 lines
3.9 KiB
PHP
Raw Normal View History

2024-09-26 15:36:56 +02:00
<?php
namespace App\Entity;
2024-09-26 15:49:16 +02:00
2024-10-03 17:23:04 +02:00
use Doctrine\Common\Collections\Collection;
use App\Repository\EmployeeRepository;
2024-09-26 15:36:56 +02:00
use Doctrine\ORM\Mapping as ORM;
2024-10-03 17:23:04 +02:00
use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
use Symfony\Component\Security\Core\User\UserInterface;
2024-09-26 15:36:56 +02:00
2024-10-03 17:23:04 +02:00
#[ORM\Entity(repositoryClass: EmployeeRepository::class)]
#[ORM\UniqueConstraint(name: 'UNIQ_IDENTIFIER_EMAIL', fields: ['email'])]
class Employee implements UserInterface, PasswordAuthenticatedUserInterface
2024-09-26 15:36:56 +02:00
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
2024-10-03 17:23:04 +02:00
#[ORM\Column(length: 180)]
private ?string $email = null;
2024-09-26 15:36:56 +02:00
#[ORM\Column(length: 30)]
private ?string $firstName = null;
#[ORM\Column(length: 30)]
private ?string $lastName = null;
2024-10-03 17:23:04 +02:00
#[ORM\Column]
private ?string $password = null;
#[ORM\ManyToOne(targetEntity: EmployeeSkill::class, inversedBy: 'employee')]
private Collection $employeeskills;
#[ORM\ManyToOne(targetEntity: Mission::class, inversedBy: 'employee')]
private Collection $missions;
#[ORM\ManyToOne(targetEntity: Incident::class, inversedBy: 'employee')]
private Collection $incidents;
#[ORM\ManyToOne(targetEntity: Assignment::class, inversedBy: 'employee')]
private Collection $assignments;
#[ORM\ManyToOne(targetEntity: Representation::class, inversedBy: 'employee')]
private Collection $representations;
public function getEmployeeskills(): Collection
{
return $this->employeeskills;
}
public function setEmployeeskills(Collection $employeeskills): void
{
$this->employeeskills = $employeeskills;
}
public function getEmployeemissions(): Collection
{
return $this->employeemissions;
}
public function setEmployeemissions(Collection $employeemissions): void
{
$this->employeemissions = $employeemissions;
}
public function getEmployeeincidents(): Collection
{
return $this->employeeincidents;
}
public function setEmployeeincidents(Collection $employeeincidents): void
{
$this->employeeincidents = $employeeincidents;
}
public function getAssignments(): Collection
{
return $this->assignments;
}
public function setAssignments(Collection $assignments): void
{
$this->assignments = $assignments;
}
public function getRepresentations(): Collection
{
return $this->representations;
}
public function setRepresentations(Collection $representations): void
{
$this->representations = $representations;
}
2024-09-26 15:36:56 +02:00
public function getId(): ?int
{
return $this->id;
}
public function setId(int $id): static
{
$this->id = $id;
return $this;
}
2024-10-03 17:23:04 +02:00
public function getEmail(): ?string
{
return $this->email;
}
public function setEmail(string $email): static
{
$this->email = $email;
return $this;
}
2024-09-26 15:36:56 +02:00
public function getFirstName(): ?string
{
return $this->firstName;
}
public function setFirstName(string $firstName): static
{
$this->firstName = $firstName;
return $this;
}
public function getLastName(): ?string
{
return $this->lastName;
}
public function setLastName(string $lastName): static
{
$this->lastName = $lastName;
return $this;
}
2024-10-03 17:23:04 +02:00
public function getPassword(): ?string
{
return $this->password;
}
public function setPassword(string $password): static
{
$this->password = $password;
return $this;
}
public function eraseCredentials(): void
{
// If you store any temporary, sensitive data on the user, clear it here
// $this->plainPassword = null;
}
public function getUserIdentifier(): string
{
return (string) $this->email;
}
2024-09-26 15:36:56 +02:00
}