src/Entity/CreditType.php line 12
<?phpnamespace App\Entity;use App\Repository\CreditTypeRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;use Gedmo\Timestampable\Traits\TimestampableEntity;#[ORM\Entity(repositoryClass: CreditTypeRepository::class)]class CreditType{use TimestampableEntity;#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(length: 255)]private ?string $name = null;#[ORM\Column(length: 255, nullable: true)]private ?string $description = null;#[ORM\ManyToOne(inversedBy: 'creditTypes')]private ?Year $year = null;#[ORM\OneToMany(mappedBy: 'creditType', targetEntity: RuleCondition::class)]private Collection $ruleConditions;#[ORM\OneToMany(mappedBy: 'creditType', targetEntity: RuleResult::class)]private Collection $ruleResults;#[ORM\OneToMany(mappedBy: 'creditType', targetEntity: Credit::class)]private Collection $credits;#[ORM\Column]private ?bool $incentiveStatement = false;#[ORM\ManyToMany(targetEntity: AttainmentMeasure::class, mappedBy: 'creditTypes')]private Collection $attainmentMeasures;public function __construct(){$this->ruleConditions = new ArrayCollection();$this->ruleResults = new ArrayCollection();$this->credits = new ArrayCollection();$this->attainmentMeasures = 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;}public function getDescription(): ?string{return $this->description;}public function setDescription(?string $description): self{$this->description = $description;return $this;}public function __toString(): string{return (string)$this->name;}public function getYear(): ?Year{return $this->year;}public function setYear(?Year $year): self{$this->year = $year;return $this;}/*** @return Collection<int, RuleCondition>*/public function getRuleConditions(): Collection{return $this->ruleConditions;}public function addRuleCondition(RuleCondition $ruleCondition): self{if (!$this->ruleConditions->contains($ruleCondition)) {$this->ruleConditions->add($ruleCondition);$ruleCondition->setCreditType($this);}return $this;}public function removeRuleCondition(RuleCondition $ruleCondition): self{if ($this->ruleConditions->removeElement($ruleCondition)) {// set the owning side to null (unless already changed)if ($ruleCondition->getCreditType() === $this) {$ruleCondition->setCreditType(null);}}return $this;}/*** @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->setCreditType($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->getCreditType() === $this) {$ruleResult->setCreditType(null);}}return $this;}/*** @return Collection<int, Credit>*/public function getCredits(): Collection{return $this->credits;}public function addCredit(Credit $credit): static{if (!$this->credits->contains($credit)) {$this->credits->add($credit);$credit->setCreditType($this);}return $this;}public function removeCredit(Credit $credit): static{if ($this->credits->removeElement($credit)) {// set the owning side to null (unless already changed)if ($credit->getCreditType() === $this) {$credit->setCreditType(null);}}return $this;}public function isIncentiveStatement(): ?bool{return $this->incentiveStatement;}public function setIncentiveStatement(bool $incentiveStatement): static{$this->incentiveStatement = $incentiveStatement;return $this;}public function getAttainmentMeasures(): Collection{return $this->attainmentMeasures;}public function addAttainmentMeasure(AttainmentMeasure $attainmentMeasure): self{if (!$this->attainmentMeasures->contains($attainmentMeasure)) {$this->attainmentMeasures[] = $attainmentMeasure;$attainmentMeasure->addCreditType($this);}return $this;}public function removeAttainmentMeasure(AttainmentMeasure $attainmentMeasure): self{if ($this->attainmentMeasures->removeElement($attainmentMeasure)) {$attainmentMeasure->removeCreditType($this);}return $this;}}