infinito/application/src/Entity/Right.php

44 lines
1.1 KiB
PHP
Raw Normal View History

2018-09-13 15:55:48 +02:00
<?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;
2018-09-13 16:37:33 +02:00
use App\Entity\Attribut\LawAttributInterface;
use App\Entity\Attribut\LawAttribut;
2018-09-13 15:55:48 +02:00
/**
*
* @author kevinfrantz
2018-09-13 16:37:33 +02:00
* @ORM\Table(name="`right`")
2018-09-13 15:55:48 +02:00
* @ORM\Entity(repositoryClass="App\Repository\RightRepository")
*/
class Right extends AbstractEntity implements RightInterface
{
2018-09-13 16:37:33 +02:00
use TypeAttribut,LawAttribut;
/**
* @ORM\ManyToOne(targetEntity="Law",cascade={"persist", "remove"})
* @ORM\JoinColumn(name="law_id", referencedColumnName="id")
* @var LawInterface
*/
protected $law;
2018-09-13 15:55:48 +02:00
/**
* @ORM\Column(name="type", type="RightType", nullable=false)
* @DoctrineAssert\Enum(entity="App\DBAL\Types\RightType")
* @var string
*/
protected $type;
public function isGranted(NodeInterface $node): bool
{}
public function setPermissions(ArrayCollection $permissions): void
{}
}