<?phpnamespace App\Entity;use App\Repository\CompanyRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass=CompanyRepository::class) * @ORM\AssociationOverrides({ * @ORM\AssociationOverride(name="company", * joinColumns=@ORM\JoinColumn(name="parent_company_id",nullable=true)) * }) */class Company extends EntityBase{ /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=255) */ private $code; /** * @ORM\Column(type="boolean") */ private $State; /** * @ORM\OneToMany(targetEntity=AppUser::class, mappedBy="Company") */ private $appUsers; /** * @ORM\OneToMany(targetEntity=Partner::class, mappedBy="company") */ private $partners; /** * @ORM\OneToMany(targetEntity=UserRole::class, mappedBy="company") */ private $userRoles; /** * @ORM\OneToMany(targetEntity=RoleAction::class, mappedBy="company") */ private $roleActions; /** * @ORM\OneToMany(targetEntity=AppActions::class, mappedBy="company") */ private $appActions; public function __construct() { $this->appUsers = new ArrayCollection(); $this->partners = new ArrayCollection(); $this->userRoles = new ArrayCollection(); $this->roleActions = new ArrayCollection(); $this->appActions = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getCode(): ?string { return $this->code; } public function setCode(string $code): self { $this->code = $code; return $this; } public function getState(): ?bool { return $this->State; } public function setState(bool $State): self { $this->State = $State; return $this; } /** * @return Collection|AppUser[] */ public function getAppUsers(): Collection { return $this->appUsers; } public function addAppUser(AppUser $appUser): self { if (!$this->appUsers->contains($appUser)) { $this->appUsers[] = $appUser; $appUser->setCompany($this); } return $this; } public function removeAppUser(AppUser $appUser): self { if ($this->appUsers->removeElement($appUser)) { // set the owning side to null (unless already changed) if ($appUser->getCompany() === $this) { $appUser->setCompany(null); } } return $this; } /** * @return Collection|UserRole[] */ public function getUserRoles(): Collection { return $this->userRoles; } public function addUserRole(UserRole $userRole): self { if (!$this->userRoles->contains($userRole)) { $this->userRoles[] = $userRole; $userRole->setCompany($this); } return $this; } public function removeUserRole(UserRole $userRole): self { if ($this->userRoles->removeElement($userRole)) { // set the owning side to null (unless already changed) if ($userRole->getCompany() === $this) { $userRole->setCompany(null); } } return $this; } /** * @return Collection|RoleAction[] */ public function getRoleActions(): Collection { return $this->roleActions; } public function addRoleAction(RoleAction $roleAction): self { if (!$this->roleActions->contains($roleAction)) { $this->roleActions[] = $roleAction; $roleAction->setCompany($this); } return $this; } public function removeRoleAction(RoleAction $roleAction): self { if ($this->roleActions->removeElement($roleAction)) { // set the owning side to null (unless already changed) if ($roleAction->getCompany() === $this) { $roleAction->setCompany(null); } } return $this; } /** * @return Collection|AppActions[] */ public function getAppActions(): Collection { return $this->appActions; } public function addAppAction(AppActions $appAction): self { if (!$this->appActions->contains($appAction)) { $this->appActions[] = $appAction; $appAction->setCompany($this); } return $this; } public function removeAppAction(AppActions $appAction): self { if ($this->appActions->removeElement($appAction)) { // set the owning side to null (unless already changed) if ($appAction->getCompany() === $this) { $appAction->setCompany(null); } } return $this; }}