src/Entity/AttainmentMeasure.php line 14
<?phpnamespace App\Entity;use App\Enum\AttainmentPeriod;use App\Repository\AttainmentMeasureRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;use Gedmo\Timestampable\Traits\TimestampableEntity;#[ORM\Entity(repositoryClass: AttainmentMeasureRepository::class)]class AttainmentMeasure{use TimestampableEntity;#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(length: 255)]private ?string $name = null;#[ORM\ManyToMany(targetEntity: CreditType::class, inversedBy: 'attainmentMeasures', cascade: ['persist', 'remove'])]private Collection $creditTypes;#[ORM\Column(length: 255, nullable: true)]private ?string $description = null;#[ORM\Column(length: 255, nullable: true)]private ?AttainmentPeriod $period = null;#[ORM\ManyToOne(inversedBy: 'attainmentMeasures')]private ?Year $year = null;#[ORM\OneToMany(mappedBy: 'attainmentMeasure', targetEntity: RuleVersion::class)]private Collection $ruleVersions;#[ORM\OneToMany(mappedBy: 'attainmentMeasure', targetEntity: RuleResult::class)]private Collection $ruleResults;public function __construct(){$this->creditTypes = new ArrayCollection();$this->ruleVersions = new ArrayCollection();$this->ruleResults = new ArrayCollection();}public function getId(): ?int{return $this->id;}public function getName(): ?string{return $this->name;}public function setName(string $name): self{$this->name = $name;return $this;}/*** @return Collection<int, CreditType>*/public function getCreditTypes(): Collection{return $this->creditTypes;}public function addCreditType(CreditType $creditType): self{if (!$this->creditTypes->contains($creditType)) {$this->creditTypes->add($creditType);}return $this;}public function removeCreditType(CreditType $creditType): self{$this->creditTypes->removeElement($creditType);return $this;}public function getDescription(): ?string{return $this->description;}public function setDescription(?string $description): self{$this->description = $description;return $this;}public function getPeriod(): ?AttainmentPeriod{return $this->period;}public function setPeriod(?AttainmentPeriod $period): self{$this->period = $period;return $this;}public function __toString(){return $this->getName();}public function getYear(): ?Year{return $this->year;}public function setYear(?Year $year): self{$this->year = $year;return $this;}/*** @return Collection<int, RuleVersion>*/public function getRuleVersions(): Collection{return $this->ruleVersions;}public function addRuleVersion(RuleVersion $ruleVersion): self{if (!$this->ruleVersions->contains($ruleVersion)) {$this->ruleVersions->add($ruleVersion);$ruleVersion->setAttainmentMeasure($this);}return $this;}public function removeRuleVersion(RuleVersion $ruleVersion): self{if ($this->ruleVersions->removeElement($ruleVersion)) {// set the owning side to null (unless already changed)if ($ruleVersion->getAttainmentMeasure() === $this) {$ruleVersion->setAttainmentMeasure(null);}}return $this;}public function displayName(){return $this->getName();}/*** @return Collection<int, RuleResult>*/public function getRuleResults(): Collection{return $this->ruleResults;}public function addRuleResult(RuleResult $ruleResult): static{if (!$this->ruleResults->contains($ruleResult)) {$this->ruleResults->add($ruleResult);$ruleResult->setAttainmentMeasure($this);}return $this;}public function removeRuleResult(RuleResult $ruleResult): static{if ($this->ruleResults->removeElement($ruleResult)) {// set the owning side to null (unless already changed)if ($ruleResult->getAttainmentMeasure() === $this) {$ruleResult->setAttainmentMeasure(null);}}return $this;}}