src/Entity/CRM/AdminDepartment.php line 11
<?phpnamespace App\Entity\CRM;use App\Repository\CRM\AdminDepartmentRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: AdminDepartmentRepository::class)]class AdminDepartment{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(length: 255)]private ?string $name = null;#[ORM\OneToMany(mappedBy: 'adminDepartment', targetEntity: Admin::class)]private Collection $admins;#[ORM\ManyToMany(targetEntity: Admin::class)]private Collection $managementStaff;public function __toString(): string{return (string) $this->name;}public function __construct(){$this->admins = new ArrayCollection();$this->managementStaff = new ArrayCollection();}public function getId(): ?int{return $this->id;}public function getName(): ?string{return $this->name;}public function setName(string $name): static{$this->name = $name;return $this;}/*** @return Collection<int, Admin>*/public function getAdmins(): Collection{return $this->admins;}public function addAdmin(Admin $admin): static{if (!$this->admins->contains($admin)) {$this->admins->add($admin);$admin->setAdminDepartment($this);}return $this;}public function removeAdmin(Admin $admin): static{if ($this->admins->removeElement($admin)) {// set the owning side to null (unless already changed)if ($admin->getAdminDepartment() === $this) {$admin->setAdminDepartment(null);}}return $this;}/*** @return Collection<int, Admin>*/public function getManagementStaff(): Collection{return $this->managementStaff;}public function addManagementStaff(Admin $managementStaff): static{if (!$this->managementStaff->contains($managementStaff)) {$this->managementStaff->add($managementStaff);}return $this;}public function removeManagementStaff(Admin $managementStaff): static{$this->managementStaff->removeElement($managementStaff);return $this;}}