infinito/application/src/Entity/Right.php

52 lines
1.2 KiB
PHP
Raw Normal View History

2018-09-13 15:55:48 +02:00
<?php
2018-09-13 16:51:58 +02:00
2018-09-13 15:55:48 +02:00
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\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;
2018-09-13 16:51:58 +02:00
2018-09-13 16:37:33 +02:00
/**
* @ORM\ManyToOne(targetEntity="Law",cascade={"persist", "remove"})
* @ORM\JoinColumn(name="law_id", referencedColumnName="id")
2018-09-13 16:51:58 +02:00
*
2018-09-13 16:37:33 +02:00
* @var LawInterface
*/
protected $law;
2018-09-13 16:51:58 +02:00
2018-09-13 15:55:48 +02:00
/**
* @ORM\Column(name="type", type="RightType", nullable=false)
* @DoctrineAssert\Enum(entity="App\DBAL\Types\RightType")
2018-09-13 16:51:58 +02:00
*
2018-09-13 15:55:48 +02:00
* @var string
*/
protected $type;
2018-09-13 16:51:58 +02:00
/**
* @ORM\OneToMany(targetEntity="Right", mappedBy="id", cascade={"persist", "remove"})
*
* @var ArrayCollection
*/
protected $permissions;
2018-09-13 15:55:48 +02:00
public function isGranted(NodeInterface $node): bool
2018-09-13 16:51:58 +02:00
{
}
2018-09-13 15:55:48 +02:00
public function setPermissions(ArrayCollection $permissions): void
2018-09-13 16:51:58 +02:00
{
}
2018-09-13 15:55:48 +02:00
}