src/Entity/CRM/DepartmentType.php line 11
<?phpnamespace App\Entity\CRM;use App\Repository\DepartmentTypeRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: DepartmentTypeRepository::class)]class DepartmentType{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(length: 255)]private ?string $name = null;#[ORM\OneToMany(mappedBy: 'departmentType', targetEntity: Department::class)]private Collection $department;#[ORM\Column(nullable: true)]private array $parameter = [];public static array $typeChoices = ['1' => 'Sprawozdania','2' => 'Test',];#[ORM\Column(nullable: true)]private ?int $type = null;#[ORM\OneToMany(mappedBy: 'departmentType', targetEntity: DepartmentTypeProductReward::class)]private Collection $departmentTypeProductRewards;#[ORM\Column(nullable: false)]private ?float $defaultReward = null;public function __construct(){$this->department = new ArrayCollection();$this->departmentTypeProductRewards = new ArrayCollection();}public function __toString(): string{return $this->name;}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, Department>*/public function getDepartment(): Collection{return $this->department;}public function addDepartment(Department $department): static{if (!$this->department->contains($department)) {$this->department->add($department);$department->setDepartmentType($this);}return $this;}public function removeDepartment(Department $department): static{if ($this->department->removeElement($department)) {// set the owning side to null (unless already changed)if ($department->getDepartmentType() === $this) {$department->setDepartmentType(null);}}return $this;}public function getParameter(): array{return $this->parameter;}public function setParameter(?array $parameter): static{$this->parameter = $parameter;return $this;}public function getTypeChoices(): array{return self::$typeChoices;}public function getType(): ?int{return $this->type;}public function setType(?int $type): static{$this->type = $type;return $this;}/*** @return Collection<int, DepartmentTypeProductReward>*/public function getDepartmentTypeProductRewards(): Collection{return $this->departmentTypeProductRewards;}public function addDepartmentTypeProductRewards(DepartmentTypeProductReward $departmentTypeProductRewards): static{if (!$this->departmentTypeProductRewards->contains($departmentTypeProductRewards)) {$this->departmentTypeProductRewards->add($departmentTypeProductRewards);$departmentTypeProductRewards->setDepartmentType($this);}return $this;}public function removeDepartmentTypeProductRewards(DepartmentTypeProductReward $departmentTypeProductRewards): static{if ($this->departmentTypeProductRewards->removeElement($departmentTypeProductRewards)) {// set the owning side to null (unless already changed)if ($departmentTypeProductRewards->getDepartmentType() === $this) {$departmentTypeProductRewards->setDepartmentType(null);}}return $this;}public function getDefaultReward(): ?float{return $this->defaultReward;}public function setDefaultReward(float $defaultReward): static{$this->defaultReward = $defaultReward;return $this;}}