mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-09-13 13:57:10 +02:00
Renamed TypeAttribut to CrudAttribut
This commit is contained in:
32
application/symfony/src/Entity/Attribut/CrudAttribut.php
Normal file
32
application/symfony/src/Entity/Attribut/CrudAttribut.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
/**
|
||||
* @todo Implement a trait for crud which substitute this one.
|
||||
*
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
trait CrudAttribut
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $crud;
|
||||
|
||||
/**
|
||||
* @param string $crud
|
||||
*/
|
||||
public function setCrud(string $crud): void
|
||||
{
|
||||
$this->crud = $crud;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getCrud(): string
|
||||
{
|
||||
return $this->crud;
|
||||
}
|
||||
}
|
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
interface CrudAttributInterface
|
||||
{
|
||||
public function setCrud(string $crud): void;
|
||||
|
||||
public function getCrud(): string;
|
||||
}
|
@@ -1,26 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
/**
|
||||
* @todo Implement a trait for crud which substitute this one.
|
||||
*
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
trait TypeAttribut
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $type;
|
||||
|
||||
public function setType(string $type): void
|
||||
{
|
||||
$this->type = $type;
|
||||
}
|
||||
|
||||
public function getType(): string
|
||||
{
|
||||
return $this->type;
|
||||
}
|
||||
}
|
@@ -1,13 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
interface TypeAttributInterface
|
||||
{
|
||||
public function setType(string $type): void;
|
||||
|
||||
public function getType(): string;
|
||||
}
|
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace App\Entity\Meta;
|
||||
|
||||
use App\Entity\Attribut\TypeAttribut;
|
||||
use App\Entity\Attribut\CrudAttribut;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Fresh\DoctrineEnumBundle\Validator\Constraints as DoctrineAssert;
|
||||
use App\Entity\Attribut\LawAttribut;
|
||||
@@ -27,7 +27,7 @@ use App\DBAL\Types\Meta\Right\CRUDType;
|
||||
*/
|
||||
class Right extends AbstractMeta implements RightInterface
|
||||
{
|
||||
use TypeAttribut,LawAttribut, RelationAttribut, GrantAttribut,ConditionAttribut,RecieverAttribut,LayerAttribut,PriorityAttribut;
|
||||
use CrudAttribut,LawAttribut, RelationAttribut, GrantAttribut,ConditionAttribut,RecieverAttribut,LayerAttribut,PriorityAttribut;
|
||||
|
||||
/**
|
||||
* @ORM\OneToOne(targetEntity="App\Entity\Source\AbstractSource",cascade={"persist", "remove"})
|
||||
@@ -77,12 +77,12 @@ class Right extends AbstractMeta implements RightInterface
|
||||
protected $grant;
|
||||
|
||||
/**
|
||||
* @ORM\Column(name="type", type="CRUDType", nullable=false)
|
||||
* @ORM\Column(name="crud", type="CRUDType", nullable=false)
|
||||
* @DoctrineAssert\Enum(entity="App\DBAL\Types\Meta\Right\CRUDType")
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $type;
|
||||
protected $crud;
|
||||
|
||||
/**
|
||||
* @ORM\OneToOne(targetEntity="App\Entity\Source\Operation\AbstractOperation",cascade={"persist"})
|
||||
@@ -102,14 +102,14 @@ class Right extends AbstractMeta implements RightInterface
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @see \App\Entity\Attribut\TypeAttributInterface::setType()
|
||||
* @see \App\Entity\Attribut\CrudAttributInterface::setCrud()
|
||||
*/
|
||||
public function setType(string $type): void
|
||||
public function setCrud(string $crud): void
|
||||
{
|
||||
if (!array_key_exists($type, CRUDType::getChoices())) {
|
||||
if (!array_key_exists($crud, CRUDType::getChoices())) {
|
||||
throw new NoValidChoiceException();
|
||||
}
|
||||
$this->type = $type;
|
||||
$this->crud = $crud;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace App\Entity\Meta;
|
||||
|
||||
use App\Entity\Attribut\TypeAttributInterface;
|
||||
use App\Entity\Attribut\CrudAttributInterface;
|
||||
use App\Entity\Attribut\LawAttributInterface;
|
||||
use App\Entity\Attribut\RecieverAttributInterface;
|
||||
use App\Entity\Attribut\GrantAttributInterface;
|
||||
@@ -14,6 +14,6 @@ use App\Entity\Attribut\PriorityAttributInterface;
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
interface RightInterface extends TypeAttributInterface, LawAttributInterface, GrantAttributInterface, RecieverAttributInterface, RelationAttributInterface, ConditionAttributInterface, LayerAttributInterface, MetaInterface, PriorityAttributInterface
|
||||
interface RightInterface extends CrudAttributInterface, LawAttributInterface, GrantAttributInterface, RecieverAttributInterface, RelationAttributInterface, ConditionAttributInterface, LayerAttributInterface, MetaInterface, PriorityAttributInterface
|
||||
{
|
||||
}
|
||||
|
Reference in New Issue
Block a user