<?php
namespace App\Entity\Slave;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Table(name="eposm_s_intervention_outcome_type")
* @ORM\Entity
*/
class InterventionOutcomeType
{
public function __toString(){
return $this->getValue();
}
/**
* @ORM\Column(name="id", type="bigint")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @ORM\Column(name="slug", type="string", length=191, unique=true)
*/
protected $slug;
/**
* @ORM\Column(name="value", type="string", length=191)
*/
protected $value;
// OneToMany
/**
* @ORM\OneToMany(targetEntity="App\Entity\Slave\InterventionOutcome", mappedBy="type")
*/
private $outcomes;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Slave\Intervention", mappedBy="outcomeType")
*/
private $interventions;
public function __construct()
{
$this->outcomes = new ArrayCollection();
$this->interventions = new ArrayCollection();
}
//
public function getId(): ?string
{
return $this->id;
}
public function getSlug(): ?string
{
return $this->slug;
}
public function setSlug(string $slug): static
{
$this->slug = $slug;
return $this;
}
public function getValue(): ?string
{
return $this->value;
}
public function setValue(string $value): static
{
$this->value = $value;
return $this;
}
/**
* @return Collection<int, InterventionOutcome>
*/
public function getOutcomes(): Collection
{
return $this->outcomes;
}
public function addOutcome(InterventionOutcome $outcome): static
{
if (!$this->outcomes->contains($outcome)) {
$this->outcomes->add($outcome);
$outcome->setType($this);
}
return $this;
}
public function removeOutcome(InterventionOutcome $outcome): static
{
if ($this->outcomes->removeElement($outcome)) {
// set the owning side to null (unless already changed)
if ($outcome->getType() === $this) {
$outcome->setType(null);
}
}
return $this;
}
/**
* @return Collection<int, Intervention>
*/
public function getInterventions(): Collection
{
return $this->interventions;
}
public function addIntervention(Intervention $intervention): static
{
if (!$this->interventions->contains($intervention)) {
$this->interventions->add($intervention);
$intervention->setOutcomeType($this);
}
return $this;
}
public function removeIntervention(Intervention $intervention): static
{
if ($this->interventions->removeElement($intervention)) {
// set the owning side to null (unless already changed)
if ($intervention->getOutcomeType() === $this) {
$intervention->setOutcomeType(null);
}
}
return $this;
}
}