<?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_join_table_account_type_permission")
* @ORM\Entity
*/
class JoinTableAccountTypePermission
{
public function displayPermission(){
if($this->rw == 'R') return 'Lettura';
if($this->rw == 'RW') return 'Lettura/Scrittura';
}
/**
* @ORM\Column(name="id", type="bigint")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @ORM\Column(name="rw", type="string")
*/
protected $rw;
// ManyToOne
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Slave\AccountType", inversedBy="permissions")
* @ORM\JoinColumn(name="account_type_id", referencedColumnName="id")
*/
private $accountType;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Slave\Permission", inversedBy="accountTypes")
* @ORM\JoinColumn(name="permission_id", referencedColumnName="id")
*/
private $permission;
//
public function getId(): ?string
{
return $this->id;
}
public function getRw(): ?string
{
return $this->rw;
}
public function setRw(string $rw): self
{
$this->rw = $rw;
return $this;
}
public function getAccountType(): ?AccountType
{
return $this->accountType;
}
public function setAccountType(?AccountType $accountType): self
{
$this->accountType = $accountType;
return $this;
}
public function getPermission(): ?Permission
{
return $this->permission;
}
public function setPermission(?Permission $permission): self
{
$this->permission = $permission;
return $this;
}
}