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
|
||||
*/
|
||||
|
@@ -53,6 +53,9 @@ final class FixtureSourceFactory implements FixtureSourceFactoryInterface
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public static function getAllFixtureSources(): array
|
||||
{
|
||||
$unfilteredClasses = self::getAllClassesInSourceFixtureNamespace();
|
||||
|
@@ -41,6 +41,8 @@ Checks if the crud, layer and source combination is granted by a right.
|
||||
### Right Layer Combination Service ###
|
||||
Allows to get the possible cruds for a layer, or the possible layers for a crud.
|
||||
## Source Management
|
||||
### Source Class Information Service ###
|
||||
Offers to get all source classes, or source classes by a namespace.
|
||||
### Source Member Information ###
|
||||
Offers to get all source members over all dimensions.
|
||||
### Source Member Manager
|
||||
|
@@ -75,7 +75,7 @@ final class SourceClassInformationService implements SourceClassInformationServi
|
||||
$this->allClasses[] = $this->transformPathToClass($path);
|
||||
}
|
||||
|
||||
private function loadClasses()
|
||||
private function loadClasses(): void
|
||||
{
|
||||
$recursiveDirectoryIterator = new \RecursiveDirectoryIterator(self::FOLDER);
|
||||
$files = new \RecursiveIteratorIterator($recursiveDirectoryIterator, \RecursiveIteratorIterator::SELF_FIRST);
|
||||
|
@@ -3,7 +3,7 @@
|
||||
namespace App\Entity\Meta;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use App\Attribut\RightsAttribute;
|
||||
use App\Attribut\RightsAttribut;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use App\Attribut\RelationAttribut;
|
||||
use App\Entity\Source\SourceInterface;
|
||||
@@ -16,7 +16,7 @@ use App\Attribut\GrantAttribut;
|
||||
*/
|
||||
class Law extends AbstractMeta implements LawInterface
|
||||
{
|
||||
use RightsAttribute, RelationAttribut, GrantAttribut;
|
||||
use RightsAttribut, RelationAttribut, GrantAttribut;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="boolean",name="`grant`")
|
||||
|
@@ -3,9 +3,9 @@
|
||||
namespace App\Entity\Meta\Relation\Parent;
|
||||
|
||||
use App\Attribut\ParentsAttributInterface;
|
||||
use App\Attribut\ChildsAttributeInterface;
|
||||
use App\Attribut\ChildsAttributInterface;
|
||||
use App\Entity\Meta\Relation\RelationInterface;
|
||||
|
||||
interface ParentRelationInterface extends RelationInterface, ParentsAttributInterface, ChildsAttributeInterface
|
||||
interface ParentRelationInterface extends RelationInterface, ParentsAttributInterface, ChildsAttributInterface
|
||||
{
|
||||
}
|
||||
|
Reference in New Issue
Block a user