infinito/application/src/Entity/Right.php
2018-09-13 22:35:32 +02:00

55 lines
1.3 KiB
PHP

<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use App\Entity\Attribut\TypeAttribut;
use App\DBAL\Types\RightType;
use Doctrine\ORM\Mapping as ORM;
use Fresh\DoctrineEnumBundle\Validator\Constraints as DoctrineAssert;
use App\Entity\Attribut\LawAttribut;
use App\Entity\Attribut\PermissionAttribut;
/**
* @author kevinfrantz
* @ORM\Table(name="`right`")
* @ORM\Entity(repositoryClass="App\Repository\RightRepository")
*/
class Right extends AbstractEntity implements RightInterface
{
use TypeAttribut,LawAttribut,PermissionAttribut;
/**
* @ORM\ManyToOne(targetEntity="Law")
* @ORM\JoinColumn(name="law_id", referencedColumnName="id")
*
* @var LawInterface
*/
protected $law;
/**
* @ORM\Column(name="type", type="RightType", nullable=false)
* @DoctrineAssert\Enum(entity="App\DBAL\Types\RightType")
*
* @var string
*/
protected $type;
/**
* @ORM\OneToMany(targetEntity="Permission", mappedBy="id", cascade={"persist", "remove"})
*
* @var ArrayCollection
*/
protected $permissions;
public function isGranted(NodeInterface $node): bool
{
}
public function __construct()
{
parent::__construct();
$this->permissions = new ArrayCollection();
}
}