src/Entity/BPModelRole.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\BPModelRoleRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=BPModelRoleRepository::class)
  9.  */
  10. class BPModelRole
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\ManyToOne(targetEntity=BPModel::class, inversedBy="bPModelRoles")
  20.      * @ORM\JoinColumn(nullable=false)
  21.      */
  22.     private $bpModel;
  23.     /**
  24.      * @ORM\ManyToOne(targetEntity=Role::class, inversedBy="bPModelRoles")
  25.      * @ORM\JoinColumn(nullable=false)
  26.      */
  27.     private $role;
  28.     /**
  29.      * @ORM\ManyToMany(targetEntity=Variable::class, inversedBy="bPModelRoles")
  30.      */
  31.     private $variables;
  32.     public function __construct()
  33.     {
  34.         $this->variables = new ArrayCollection();
  35.     }
  36.     public function getId(): ?int
  37.     {
  38.         return $this->id;
  39.     }
  40.     public function getBpModel(): ?BPModel
  41.     {
  42.         return $this->bpModel;
  43.     }
  44.     public function setBpModel(?BPModel $bpModel): self
  45.     {
  46.         $this->bpModel $bpModel;
  47.         return $this;
  48.     }
  49.     public function getRole(): ?Role
  50.     {
  51.         return $this->role;
  52.     }
  53.     public function setRole(?Role $role): self
  54.     {
  55.         $this->role $role;
  56.         return $this;
  57.     }
  58.     /**
  59.      * @return Collection<int, Variable>
  60.      */
  61.     public function getVariables(): Collection
  62.     {
  63.         return $this->variables;
  64.     }
  65.     public function addVariable(Variable $variable): self
  66.     {
  67.         if (!$this->variables->contains($variable)) {
  68.             $this->variables[] = $variable;
  69.         }
  70.         return $this;
  71.     }
  72.     public function removeVariable(Variable $variable): self
  73.     {
  74.         $this->variables->removeElement($variable);
  75.         return $this;
  76.     }
  77. }