mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-09-13 13:57:10 +02:00
Optimized Attributes and tests for it
This commit is contained in:
@@ -5,12 +5,14 @@ namespace App\Attribut;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
|
||||
/**
|
||||
* @see ChildsAttributInterface
|
||||
*
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
trait ChildsAttribut
|
||||
{
|
||||
/**
|
||||
* @var Collection|ChildsAttributeInterface[]
|
||||
* @var Collection|ChildsAttributInterface[]
|
||||
*/
|
||||
protected $childs;
|
||||
|
||||
|
@@ -7,7 +7,7 @@ use Doctrine\Common\Collections\Collection;
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
interface ChildsAttributeInterface
|
||||
interface ChildsAttributInterface
|
||||
{
|
||||
public function setChilds(Collection $childs): void;
|
||||
|
@@ -7,6 +7,8 @@ namespace App\Attribut;
|
||||
*/
|
||||
interface ClassAttributInterface
|
||||
{
|
||||
const CLASS_ATTRIBUT_NAME = 'class';
|
||||
|
||||
/**
|
||||
* @param string $class
|
||||
*/
|
||||
|
@@ -4,6 +4,8 @@ This folder containes the attributs which are used by entity, domain logic etc.
|
||||
Each attribut containes out of an interface and a trait.
|
||||
## Interface
|
||||
The interface MUST define a __get-__ and a __set-method__. Optional an interface can define a __has-method__.
|
||||
For meta processing an interface SHOULD contain one constant which is named by the schema __<<ATTRIBUT>>_ATTRIBUT_NAME__.
|
||||
An interface MUST NOT implement other constants.
|
||||
### Methods
|
||||
#### Set
|
||||
The __setter__ MUST return nothing(void). It SHOULD throw an exception if the value is not valid.
|
||||
|
@@ -6,8 +6,10 @@ use Doctrine\Common\Collections\Collection;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*
|
||||
* @see RightsAttributInterface
|
||||
*/
|
||||
trait RightsAttribute
|
||||
trait RightsAttribut
|
||||
{
|
||||
/**
|
||||
* @var Collection
|
@@ -10,6 +10,8 @@ use App\Entity\Meta\RightInterface;
|
||||
*/
|
||||
interface RightsAttributInterface
|
||||
{
|
||||
const RIGHTS_ATTRIBUT_NAME = 'rights';
|
||||
|
||||
/**
|
||||
* @param Collection|RightInterface[] $rights
|
||||
*/
|
||||
|
Reference in New Issue
Block a user