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.         public function getId(): ?string
  40.         {
  41.             return $this->id;
  42.         }
  43.         public function getRw(): ?string
  44.         {
  45.             return $this->rw;
  46.         }
  47.         public function setRw(string $rw): static
  48.         {
  49.             $this->rw $rw;
  50.             return $this;
  51.         }
  52.         public function getAccountType(): ?AccountType
  53.         {
  54.             return $this->accountType;
  55.         }
  56.         public function setAccountType(?AccountType $accountType): static
  57.         {
  58.             $this->accountType $accountType;
  59.             return $this;
  60.         }
  61.         public function getPermission(): ?Permission
  62.         {
  63.             return $this->permission;
  64.         }
  65.         public function setPermission(?Permission $permission): static
  66.         {
  67.             $this->permission $permission;
  68.             return $this;
  69.         }
  70. }