src/Entity/GenericRecommendation.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\GenericRecommendationRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Overblog\GraphQLBundle\Annotation\Field;
  9. #[ORM\Entity(repositoryClassGenericRecommendationRepository::class)]
  10. class GenericRecommendation extends Recommendation
  11. {
  12.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  13.     #[Field(name"action"type"string")]
  14.     protected ?string $action null;
  15.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  16.     #[Field(name"benefit"type"string")]
  17.     protected ?string $benefit null;
  18.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  19.     #[Field(name"domain_id"type"integer")]
  20.     protected ?int $domain_id null;
  21.     #[ORM\ManyToMany(targetEntityDomain::class, mappedBy'implementedGenericRecommendations')]
  22.     private Collection $domains;
  23.     public function __construct()
  24.     {
  25.         $this->domains = new ArrayCollection();
  26.     }
  27.     public function getAction(): ?string
  28.     {
  29.         return $this->action;
  30.     }
  31.     public function setAction(?string $action): self
  32.     {
  33.         $this->action $action;
  34.         return $this;
  35.     }
  36.     public function getBenefit(): ?string
  37.     {
  38.         return $this->benefit;
  39.     }
  40.     public function setBenefit(?string $benefit): self
  41.     {
  42.         $this->benefit $benefit;
  43.         return $this;
  44.     }
  45.     /**
  46.      * @return Collection<int, Domain>
  47.      */
  48.     public function getDomains(): Collection
  49.     {
  50.         return $this->domains;
  51.     }
  52.     public function addDomain(Domain $domain): static
  53.     {
  54.         if (!$this->domains->contains($domain)) {
  55.             $this->domains->add($domain);
  56.             $domain->addImplementedGenericRecommendation($this);
  57.         }
  58.         return $this;
  59.     }
  60.     public function removeDomain(Domain $domain): static
  61.     {
  62.         if ($this->domains->removeElement($domain)) {
  63.             $domain->removeImplementedGenericRecommendation($this);
  64.         }
  65.         return $this;
  66.     }
  67. }