Renamed TypeAttribut to CrudAttribut

This commit is contained in:
Kevin Frantz
2019-01-16 21:22:18 +01:00
parent 665f0044cc
commit 93bf246915
28 changed files with 113 additions and 107 deletions

View 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;
}
}

View File

@@ -0,0 +1,13 @@
<?php
namespace App\Entity\Attribut;
/**
* @author kevinfrantz
*/
interface CrudAttributInterface
{
public function setCrud(string $crud): void;
public function getCrud(): string;
}

View File

@@ -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;
}
}

View File

@@ -1,13 +0,0 @@
<?php
namespace App\Entity\Attribut;
/**
* @author kevinfrantz
*/
interface TypeAttributInterface
{
public function setType(string $type): void;
public function getType(): string;
}

View File

@@ -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;
}
/**

View File

@@ -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
{
}