src/Entity/Department.php line 12
<?phpnamespace App\Entity;use App\Repository\DepartmentRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: DepartmentRepository::class)]class Department{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column(length: 2)]private ?string $departmentCode = null;#[ORM\Column(length: 255)]private ?string $name = null;#[ORM\Column(type: Types::TEXT, nullable: true)]private ?string $description = null;#[ORM\Column(type: Types::DATETIME_MUTABLE)]private ?\DateTimeInterface $updated = null;#[ORM\Column]private ?int $updatedBy = null;#[ORM\OneToMany(mappedBy: 'department', targetEntity: TeamMember::class)]private Collection $teamMembers;public function __construct(){$this->teamMembers = new ArrayCollection();}public function getDepartmentCode(): ?string{return $this->departmentCode;}public function setDepartmentCode(string $departmentCode): static{$this->departmentCode = $departmentCode;return $this;}public function getName(): ?string{return $this->name;}public function setName(string $name): static{$this->name = $name;return $this;}public function getDescription(): ?string{return $this->description;}public function setDescription(?string $description): static{$this->description = $description;return $this;}public function getUpdatedBy(): ?int{return $this->updatedBy;}public function setUpdatedBy(int $updatedBy): static{$this->updatedBy = $updatedBy;return $this;}/*** @return Collection<int, TeamMember>*/public function getTeamMembers(): Collection{return $this->teamMembers;}public function addTeamMember(TeamMember $teamMember): static{if (!$this->teamMembers->contains($teamMember)) {$this->teamMembers->add($teamMember);$teamMember->setDepartment($this);}return $this;}public function removeTeamMember(TeamMember $teamMember): static{if ($this->teamMembers->removeElement($teamMember)) {// set the owning side to null (unless already changed)if ($teamMember->getDepartment() === $this) {$teamMember->setDepartment(null);}}return $this;}}