src/Entity/Slave/JoinTableAccountTypePermission.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Slave;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\DBAL\Types\Types;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Table(name="eposm_s_join_table_account_type_permission")
  9.  * @ORM\Entity
  10.  */
  11. class JoinTableAccountTypePermission
  12. {
  13.     public function displayPermission(){
  14.         if($this->rw == 'R') return 'Lettura';
  15.         if($this->rw == 'RW') return 'Lettura/Scrittura';
  16.     }
  17.     /**
  18.      * @ORM\Column(name="id", type="bigint")
  19.      * @ORM\Id
  20.      * @ORM\GeneratedValue(strategy="AUTO")
  21.      */
  22.     protected $id;
  23.     
  24.     /**
  25.      * @ORM\Column(name="rw", type="string")
  26.      */
  27.     protected $rw;
  28.     // ManyToOne
  29.         /**
  30.          * @ORM\ManyToOne(targetEntity="App\Entity\Slave\AccountType", inversedBy="permissions")
  31.          * @ORM\JoinColumn(name="account_type_id", referencedColumnName="id")
  32.          */
  33.         private $accountType;
  34.         /**
  35.          * @ORM\ManyToOne(targetEntity="App\Entity\Slave\Permission", inversedBy="accountTypes")
  36.          * @ORM\JoinColumn(name="permission_id", referencedColumnName="id")
  37.          */
  38.         private $permission;
  39.     //
  40.     public function getId(): ?string
  41.     {
  42.         return $this->id;
  43.     }
  44.     public function getRw(): ?string
  45.     {
  46.         return $this->rw;
  47.     }
  48.     public function setRw(string $rw): self
  49.     {
  50.         $this->rw $rw;
  51.         return $this;
  52.     }
  53.     public function getAccountType(): ?AccountType
  54.     {
  55.         return $this->accountType;
  56.     }
  57.     public function setAccountType(?AccountType $accountType): self
  58.     {
  59.         $this->accountType $accountType;
  60.         return $this;
  61.     }
  62.     public function getPermission(): ?Permission
  63.     {
  64.         return $this->permission;
  65.     }
  66.     public function setPermission(?Permission $permission): self
  67.     {
  68.         $this->permission $permission;
  69.         return $this;
  70.     }
  71. }