mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-09-13 13:57:10 +02:00
Optimized for SPA
This commit is contained in:
0
application/symfony/src/Entity/.gitignore
vendored
Normal file
0
application/symfony/src/Entity/.gitignore
vendored
Normal file
41
application/symfony/src/Entity/AbstractEntity.php
Normal file
41
application/symfony/src/Entity/AbstractEntity.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Entity\Attribut\IdAttribut;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use App\Entity\Attribut\VersionAttribut;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
abstract class AbstractEntity implements EntityInterface
|
||||
{
|
||||
use IdAttribut, VersionAttribut;
|
||||
|
||||
/**
|
||||
* @ORM\Id()
|
||||
* @ORM\GeneratedValue
|
||||
* @ORM\Column(type="integer")(strategy="AUTO")
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $id;
|
||||
|
||||
/**
|
||||
* @version @ORM\Column(type="integer")
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $version;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->version = 0;
|
||||
}
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
return __CLASS__.':'.spl_object_hash($this);
|
||||
}
|
||||
}
|
26
application/symfony/src/Entity/Attribut/ChildsAttribut.php
Normal file
26
application/symfony/src/Entity/Attribut/ChildsAttribut.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
trait ChildsAttribut
|
||||
{
|
||||
/**
|
||||
* @var Collection|ChildsAttributeInterface[]
|
||||
*/
|
||||
protected $childs;
|
||||
|
||||
public function getChilds(): Collection
|
||||
{
|
||||
return $this->childs;
|
||||
}
|
||||
|
||||
public function setChilds(Collection $childs): void
|
||||
{
|
||||
$this->childs = $childs;
|
||||
}
|
||||
}
|
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
interface ChildsAttributeInterface
|
||||
{
|
||||
public function setChilds(Collection $childs): void;
|
||||
|
||||
public function getChilds(): Collection;
|
||||
}
|
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
|
||||
trait CollectionAttribut
|
||||
{
|
||||
/**
|
||||
* @var Collection
|
||||
*/
|
||||
protected $collection;
|
||||
|
||||
/**
|
||||
* @return Collection
|
||||
*/
|
||||
public function getCollection(): Collection
|
||||
{
|
||||
return $this->collection;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Collection $collection
|
||||
*/
|
||||
public function setCollection(Collection $collection): void
|
||||
{
|
||||
$this->collection = $collection;
|
||||
}
|
||||
}
|
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
|
||||
interface CollectionAttributInterface
|
||||
{
|
||||
public function getCollection(): Collection;
|
||||
|
||||
public function setCollection(Collection $collection): void;
|
||||
}
|
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
use App\Logic\Operation\OperationInterface;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
trait ConditionAttribut
|
||||
{
|
||||
/**
|
||||
* @var OperationInterface
|
||||
*/
|
||||
protected $condition;
|
||||
|
||||
public function getCondition(): OperationInterface
|
||||
{
|
||||
return $this->condition;
|
||||
}
|
||||
|
||||
public function setCondition(OperationInterface $condition): void
|
||||
{
|
||||
$this->condition = $condition;
|
||||
}
|
||||
|
||||
public function hasCondition(): bool
|
||||
{
|
||||
return $this->condition instanceof OperationInterface;
|
||||
}
|
||||
}
|
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
use App\Logic\Operation\OperationInterface;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
interface ConditionAttributInterface
|
||||
{
|
||||
public function getCondition(): OperationInterface;
|
||||
|
||||
public function setCondition(OperationInterface $operation): void;
|
||||
|
||||
public function hasCondition(): bool;
|
||||
}
|
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
use App\Entity\Meta\Relation\Parent\CreatorRelationInterface;
|
||||
|
||||
trait CreatorRelationAttribut
|
||||
{
|
||||
/**
|
||||
* @var CreatorRelationInterface
|
||||
*/
|
||||
protected $creatorRelation;
|
||||
|
||||
public function setCreatorRelation(CreatorRelationInterface $creatorRelation)
|
||||
{
|
||||
$this->creatorRelation = $creatorRelation;
|
||||
}
|
||||
|
||||
public function getCreatorRelation(): CreatorRelationInterface
|
||||
{
|
||||
return $this->creatorRelation;
|
||||
}
|
||||
}
|
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
use App\Entity\Meta\Relation\Parent\CreatorRelationInterface;
|
||||
|
||||
interface CreatorRelationAttributInterface
|
||||
{
|
||||
public function setCreatorRelation(CreatorRelationInterface $creatorRelation);
|
||||
|
||||
public function getCreatorRelation(): CreatorRelationInterface;
|
||||
}
|
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
use App\Entity\Source\Primitive\Name\FirstNameSourceInterface;
|
||||
|
||||
trait FirstNameSourceAttribut
|
||||
{
|
||||
/**
|
||||
* @var FirstNameSourceInterface
|
||||
*/
|
||||
protected $firstNameSource;
|
||||
|
||||
public function getFirstNameSource(): FirstNameSourceInterface
|
||||
{
|
||||
return $this->firstNameSource;
|
||||
}
|
||||
|
||||
public function setFirstNameSource(FirstNameSourceInterface $name): void
|
||||
{
|
||||
$this->firstNameSource = $name;
|
||||
}
|
||||
}
|
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
use App\Entity\Source\Primitive\Name\FirstNameSourceInterface;
|
||||
|
||||
interface FirstNameSourceAttributInterface
|
||||
{
|
||||
public function getFirstNameSource(): FirstNameSourceInterface;
|
||||
|
||||
public function setFirstNameSource(FirstNameSourceInterface $name): void;
|
||||
}
|
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
use App\Entity\Source\Complex\FullPersonNameSourceInterface;
|
||||
|
||||
trait FullPersonNameSourceAttribut
|
||||
{
|
||||
/**
|
||||
* @var FullPersonNameSourceInterface
|
||||
*/
|
||||
protected $fullPersonNameSource;
|
||||
|
||||
public function getFullPersonNameSource(): FullPersonNameSourceInterface
|
||||
{
|
||||
return $this->fullPersonNameSource;
|
||||
}
|
||||
|
||||
public function setFullPersonNameSource(FullPersonNameSourceInterface $fullname): void
|
||||
{
|
||||
$this->fullPersonNameSource = $fullname;
|
||||
}
|
||||
}
|
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
use App\Entity\Source\Complex\FullPersonNameSourceInterface;
|
||||
|
||||
interface FullPersonNameSourceAttributInterface
|
||||
{
|
||||
public function getFullPersonNameSource(): FullPersonNameSourceInterface;
|
||||
|
||||
public function setFullPersonNameSource(FullPersonNameSourceInterface $fullname): void;
|
||||
}
|
24
application/symfony/src/Entity/Attribut/GrantAttribut.php
Normal file
24
application/symfony/src/Entity/Attribut/GrantAttribut.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
trait GrantAttribut
|
||||
{
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
protected $grant;
|
||||
|
||||
public function setGrant(bool $grant): void
|
||||
{
|
||||
$this->grant = $grant;
|
||||
}
|
||||
|
||||
public function getGrant(): bool
|
||||
{
|
||||
return $this->grant;
|
||||
}
|
||||
}
|
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
interface GrantAttributInterface
|
||||
{
|
||||
public function setGrant(bool $grant): void;
|
||||
|
||||
public function getGrant(): bool;
|
||||
}
|
24
application/symfony/src/Entity/Attribut/IdAttribut.php
Normal file
24
application/symfony/src/Entity/Attribut/IdAttribut.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
trait IdAttribut
|
||||
{
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
protected $id;
|
||||
|
||||
public function setId(int $id): void
|
||||
{
|
||||
$this->id = $id;
|
||||
}
|
||||
|
||||
public function getId(): int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
}
|
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
interface IdAttributInterface
|
||||
{
|
||||
public function setId(int $id): void;
|
||||
|
||||
public function getId(): int;
|
||||
}
|
26
application/symfony/src/Entity/Attribut/LawAttribut.php
Normal file
26
application/symfony/src/Entity/Attribut/LawAttribut.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
use App\Entity\Meta\LawInterface;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
trait LawAttribut
|
||||
{
|
||||
/**
|
||||
* @var LawInterface
|
||||
*/
|
||||
protected $law;
|
||||
|
||||
public function setLaw(LawInterface $law): void
|
||||
{
|
||||
$this->law = $law;
|
||||
}
|
||||
|
||||
public function getLaw(): LawInterface
|
||||
{
|
||||
return $this->law;
|
||||
}
|
||||
}
|
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
use App\Entity\Meta\LawInterface;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
interface LawAttributInterface
|
||||
{
|
||||
public function setLaw(LawInterface $law): void;
|
||||
|
||||
public function getLaw(): LawInterface;
|
||||
}
|
24
application/symfony/src/Entity/Attribut/LayerAttribut.php
Normal file
24
application/symfony/src/Entity/Attribut/LayerAttribut.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
trait LayerAttribut
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $layer;
|
||||
|
||||
public function setLayer(string $layer): void
|
||||
{
|
||||
$this->layer = $layer;
|
||||
}
|
||||
|
||||
public function getLayer(): string
|
||||
{
|
||||
return $this->layer;
|
||||
}
|
||||
}
|
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
interface LayerAttributInterface
|
||||
{
|
||||
public function setLayer(string $layer): void;
|
||||
|
||||
public function getLayer(): string;
|
||||
}
|
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
use App\Entity\Meta\Relation\Member\MemberRelationInterface;
|
||||
|
||||
trait MemberRelationAttribut
|
||||
{
|
||||
/**
|
||||
* @var MemberRelationInterface
|
||||
*/
|
||||
protected $memberRelation;
|
||||
|
||||
public function setMemberRelation(MemberRelationInterface $memberRelation): void
|
||||
{
|
||||
$this->memberRelation = $memberRelation;
|
||||
}
|
||||
|
||||
public function getMemberRelation(): MemberRelationInterface
|
||||
{
|
||||
return $this->memberRelation;
|
||||
}
|
||||
}
|
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
use App\Entity\Meta\Relation\Member\MemberRelationInterface;
|
||||
|
||||
interface MemberRelationAttributInterface
|
||||
{
|
||||
public function setMemberRelation(MemberRelationInterface $memberRelation): void;
|
||||
|
||||
public function getMemberRelation(): MemberRelationInterface;
|
||||
}
|
33
application/symfony/src/Entity/Attribut/MembersAttribut.php
Normal file
33
application/symfony/src/Entity/Attribut/MembersAttribut.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use App\Entity\Meta\Relation\Member\MemberRelationInterface;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
trait MembersAttribut
|
||||
{
|
||||
/**
|
||||
* @var Collection|MemberRelationInterface[]
|
||||
*/
|
||||
protected $members;
|
||||
|
||||
/**
|
||||
* @return Collection|MemberRelationInterface[]
|
||||
*/
|
||||
public function getMembers(): Collection
|
||||
{
|
||||
return $this->members;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Collection|MemberRelationInterface[] $members
|
||||
*/
|
||||
public function setMembers(Collection $members): void
|
||||
{
|
||||
$this->members = $members;
|
||||
}
|
||||
}
|
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use App\Entity\Meta\Relation\Member\MemberRelationInterface;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
interface MembersAttributInterface
|
||||
{
|
||||
/**
|
||||
* @param Collection|MemberRelationInterface[] $members
|
||||
*/
|
||||
public function setMembers(Collection $members): void;
|
||||
|
||||
/**
|
||||
* @return Collection|MemberRelationInterface[]
|
||||
*/
|
||||
public function getMembers(): Collection;
|
||||
}
|
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use App\Entity\Meta\Relation\Member\MemberRelationInterface;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
trait MembershipsAttribut
|
||||
{
|
||||
/**
|
||||
* @var Collection|MemberRelationInterface[]
|
||||
*/
|
||||
protected $memberships;
|
||||
|
||||
/**
|
||||
* @return Collection|MemberRelationInterface[]
|
||||
*/
|
||||
public function getMemberships(): Collection
|
||||
{
|
||||
return $this->memberships;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Collection|MemberRelationInterface[] $memberships
|
||||
*/
|
||||
public function setMemberships(Collection $memberships): void
|
||||
{
|
||||
$this->memberships = $memberships;
|
||||
}
|
||||
}
|
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use App\Entity\Meta\Relation\Member\MemberRelationInterface;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
interface MembershipsAttributInterface
|
||||
{
|
||||
/**
|
||||
* @param Collection|MemberRelationInterface[] $groups
|
||||
*/
|
||||
public function setMemberships(Collection $memberships): void;
|
||||
|
||||
/**
|
||||
* @return Collection|MemberRelationInterface[]
|
||||
*/
|
||||
public function getMemberships(): Collection;
|
||||
}
|
24
application/symfony/src/Entity/Attribut/NameAttribut.php
Normal file
24
application/symfony/src/Entity/Attribut/NameAttribut.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
trait NameAttribut
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $name;
|
||||
|
||||
public function setName(string $name): void
|
||||
{
|
||||
$this->name = $name;
|
||||
}
|
||||
|
||||
public function getName(): string
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
}
|
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
interface NameAttributInterface
|
||||
{
|
||||
public function setName(string $name): void;
|
||||
|
||||
public function getName(): string;
|
||||
}
|
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
use App\Entity\Source\Primitive\Name\NameSourceInterface;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
trait NameSourceAttribut
|
||||
{
|
||||
/**
|
||||
* @var NameSourceInterface
|
||||
*/
|
||||
protected $nameSource;
|
||||
|
||||
public function setNameSource(NameSourceInterface $nameSource): void
|
||||
{
|
||||
$this->nameSource = $nameSource;
|
||||
}
|
||||
|
||||
public function getNameSource(): NameSourceInterface
|
||||
{
|
||||
return $this->nameSource;
|
||||
}
|
||||
}
|
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
use App\Entity\Source\Primitive\Name\NameSourceInterface;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
interface NameSourceAttributInterface
|
||||
{
|
||||
public function setNameSource(NameSourceInterface $nameSource): void;
|
||||
|
||||
public function getNameSource(): NameSourceInterface;
|
||||
}
|
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
use App\Entity\Meta\Relation\Parent\ParentRelationInterface;
|
||||
|
||||
trait ParentRelationAttribut
|
||||
{
|
||||
/**
|
||||
* @var ParentRelationInterface
|
||||
*/
|
||||
protected $parentRelation;
|
||||
|
||||
public function setParentRelation(ParentRelationInterface $parentRelation): void
|
||||
{
|
||||
$this->parentRelation = $parentRelation;
|
||||
}
|
||||
|
||||
public function getParentRelation(): ParentRelationInterface
|
||||
{
|
||||
return $this->parentRelation;
|
||||
}
|
||||
}
|
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
use App\Entity\Meta\Relation\Parent\ParentRelationInterface;
|
||||
|
||||
interface ParentRelationAttributInterface
|
||||
{
|
||||
public function setParentRelation(ParentRelationInterface $parentRelation): void;
|
||||
|
||||
public function getParentRelation(): ParentRelationInterface;
|
||||
}
|
26
application/symfony/src/Entity/Attribut/ParentsAttribut.php
Normal file
26
application/symfony/src/Entity/Attribut/ParentsAttribut.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
trait ParentsAttribut
|
||||
{
|
||||
/**
|
||||
* @var Collection|ParentsAttributInterface[]
|
||||
*/
|
||||
protected $parents;
|
||||
|
||||
public function getParents(): Collection
|
||||
{
|
||||
return $this->parents;
|
||||
}
|
||||
|
||||
public function setParents(Collection $parents): void
|
||||
{
|
||||
$this->parents = $parents;
|
||||
}
|
||||
}
|
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
interface ParentsAttributInterface
|
||||
{
|
||||
public function setParents(Collection $parents): void;
|
||||
|
||||
public function getParents(): Collection;
|
||||
}
|
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
use App\Entity\Source\Complex\PersonIdentitySourceInterface;
|
||||
|
||||
trait PersonIdentitySourceAttribut
|
||||
{
|
||||
/**
|
||||
* @var PersonIdentitySourceInterface
|
||||
*/
|
||||
protected $personIdentitySource;
|
||||
|
||||
public function getPersonIdentitySource(): PersonIdentitySourceInterface
|
||||
{
|
||||
return $this->personIdentitySource;
|
||||
}
|
||||
|
||||
public function setPersonIdentitySource(PersonIdentitySourceInterface $identity): void
|
||||
{
|
||||
$this->personIdentitySource = $identity;
|
||||
}
|
||||
}
|
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
use App\Entity\Source\Complex\PersonIdentitySourceInterface;
|
||||
|
||||
interface PersonIdentitySourceAttributInterface
|
||||
{
|
||||
public function getPersonIdentitySource(): PersonIdentitySourceInterface;
|
||||
|
||||
public function setPersonIdentitySource(PersonIdentitySourceInterface $identity): void;
|
||||
}
|
21
application/symfony/src/Entity/Attribut/PriorityAttribut.php
Normal file
21
application/symfony/src/Entity/Attribut/PriorityAttribut.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
trait PriorityAttribut
|
||||
{
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
protected $priority;
|
||||
|
||||
public function setPriority(int $priority): void
|
||||
{
|
||||
$this->priority = $priority;
|
||||
}
|
||||
|
||||
public function getPriority(): int
|
||||
{
|
||||
return $this->priority;
|
||||
}
|
||||
}
|
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
interface PriorityAttributInterface
|
||||
{
|
||||
public function setPriority(int $priority): void;
|
||||
|
||||
public function getPriority(): int;
|
||||
}
|
26
application/symfony/src/Entity/Attribut/RecieverAttribut.php
Normal file
26
application/symfony/src/Entity/Attribut/RecieverAttribut.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
use App\Entity\Source\SourceInterface;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
trait RecieverAttribut
|
||||
{
|
||||
/**
|
||||
* @var SourceInterface
|
||||
*/
|
||||
protected $reciever;
|
||||
|
||||
public function setReciever(SourceInterface $reciever): void
|
||||
{
|
||||
$this->reciever = $reciever;
|
||||
}
|
||||
|
||||
public function getReciever(): SourceInterface
|
||||
{
|
||||
return $this->reciever;
|
||||
}
|
||||
}
|
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
use App\Entity\Source\SourceInterface;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
interface RecieverAttributInterface
|
||||
{
|
||||
public function setReciever(SourceInterface $reciever): void;
|
||||
|
||||
public function getReciever(): SourceInterface;
|
||||
}
|
26
application/symfony/src/Entity/Attribut/RelationAttribut.php
Normal file
26
application/symfony/src/Entity/Attribut/RelationAttribut.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
use App\Entity\Meta\Relation\RelationInterface;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
trait RelationAttribut
|
||||
{
|
||||
/**
|
||||
* @var RelationInterface
|
||||
*/
|
||||
protected $relation;
|
||||
|
||||
public function setRelation(RelationInterface $relation): void
|
||||
{
|
||||
$this->relation = $relation;
|
||||
}
|
||||
|
||||
public function getRelation(): RelationInterface
|
||||
{
|
||||
return $this->relation;
|
||||
}
|
||||
}
|
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
use App\Entity\Meta\Relation\RelationInterface;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
interface RelationAttributInterface
|
||||
{
|
||||
public function setRelation(RelationInterface $relation): void;
|
||||
|
||||
public function getRelation(): RelationInterface;
|
||||
}
|
26
application/symfony/src/Entity/Attribut/RightAttribut.php
Normal file
26
application/symfony/src/Entity/Attribut/RightAttribut.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
use App\Entity\Meta\RightInterface;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
trait RightAttribut
|
||||
{
|
||||
/**
|
||||
* @var RightInterface
|
||||
*/
|
||||
protected $right;
|
||||
|
||||
public function setRight(RightInterface $right): void
|
||||
{
|
||||
$this->right = $right;
|
||||
}
|
||||
|
||||
public function getRight(): RightInterface
|
||||
{
|
||||
return $this->right;
|
||||
}
|
||||
}
|
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
use App\Entity\Meta\RightInterface;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
interface RightAttributInterface
|
||||
{
|
||||
public function setRight(RightInterface $right): void;
|
||||
|
||||
public function getRight(): RightInterface;
|
||||
}
|
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use App\Entity\Meta\RightInterface;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
interface RightsAttributInterface
|
||||
{
|
||||
/**
|
||||
* @param Collection|RightInterface[] $rights
|
||||
*/
|
||||
public function setRights(Collection $rights): void;
|
||||
|
||||
/**
|
||||
* @return Collection|RightInterface[]
|
||||
*/
|
||||
public function getRights(): Collection;
|
||||
}
|
26
application/symfony/src/Entity/Attribut/RightsAttribute.php
Normal file
26
application/symfony/src/Entity/Attribut/RightsAttribute.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
trait RightsAttribute
|
||||
{
|
||||
/**
|
||||
* @var Collection
|
||||
*/
|
||||
protected $rights;
|
||||
|
||||
public function setRights(Collection $rights): void
|
||||
{
|
||||
$this->rights = $rights;
|
||||
}
|
||||
|
||||
public function getRights(): Collection
|
||||
{
|
||||
return $this->rights;
|
||||
}
|
||||
}
|
21
application/symfony/src/Entity/Attribut/SlugAttribut.php
Normal file
21
application/symfony/src/Entity/Attribut/SlugAttribut.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
trait SlugAttribut
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $slug;
|
||||
|
||||
public function setSlug(string $slug): void
|
||||
{
|
||||
$this->slug = $slug;
|
||||
}
|
||||
|
||||
public function getSlug(): string
|
||||
{
|
||||
return $this->slug;
|
||||
}
|
||||
}
|
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
interface SlugAttributInterface
|
||||
{
|
||||
public function setSlug(string $slug): void;
|
||||
|
||||
public function getSlug(): string;
|
||||
}
|
26
application/symfony/src/Entity/Attribut/SourceAttribut.php
Normal file
26
application/symfony/src/Entity/Attribut/SourceAttribut.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
use App\Entity\Source\SourceInterface;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
trait SourceAttribut
|
||||
{
|
||||
/**
|
||||
* @var SourceInterface
|
||||
*/
|
||||
protected $source;
|
||||
|
||||
public function getSource(): SourceInterface
|
||||
{
|
||||
return $this->source;
|
||||
}
|
||||
|
||||
public function setSource(SourceInterface $source): void
|
||||
{
|
||||
$this->source = $source;
|
||||
}
|
||||
}
|
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
use App\Entity\Source\SourceInterface;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
interface SourceAttributInterface
|
||||
{
|
||||
public function getSource(): SourceInterface;
|
||||
|
||||
public function setSource(SourceInterface $source): void;
|
||||
}
|
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
use App\Entity\Source\Primitive\Name\SurnameSourceInterface;
|
||||
|
||||
trait SurnameSourceAttribut
|
||||
{
|
||||
/**
|
||||
* @var SurnameSourceInterface
|
||||
*/
|
||||
protected $surnameSource;
|
||||
|
||||
public function getSurnameSource(): SurnameSourceInterface
|
||||
{
|
||||
return $this->surnameSource;
|
||||
}
|
||||
|
||||
public function setSurnameSource(SurnameSourceInterface $name): void
|
||||
{
|
||||
$this->surnameSource = $name;
|
||||
}
|
||||
}
|
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
use App\Entity\Source\Primitive\Name\SurnameSourceInterface;
|
||||
|
||||
interface SurnameSourceAttributInterface
|
||||
{
|
||||
public function getSurnameSource(): SurnameSourceInterface;
|
||||
|
||||
public function setSurnameSource(SurnameSourceInterface $name): void;
|
||||
}
|
21
application/symfony/src/Entity/Attribut/TextAttribut.php
Normal file
21
application/symfony/src/Entity/Attribut/TextAttribut.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
trait TextAttribut
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $text;
|
||||
|
||||
public function getText(): string
|
||||
{
|
||||
return $this->text;
|
||||
}
|
||||
|
||||
public function setText(string $text): void
|
||||
{
|
||||
$this->text = $text;
|
||||
}
|
||||
}
|
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
interface TextAttributInterface
|
||||
{
|
||||
public function getText(): string;
|
||||
|
||||
public function setText(string $text): void;
|
||||
}
|
24
application/symfony/src/Entity/Attribut/TypeAttribut.php
Normal file
24
application/symfony/src/Entity/Attribut/TypeAttribut.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
trait TypeAttribut
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $type;
|
||||
|
||||
public function setType(string $type): void
|
||||
{
|
||||
$this->type = $type;
|
||||
}
|
||||
|
||||
public function getType(): string
|
||||
{
|
||||
return $this->type;
|
||||
}
|
||||
}
|
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
interface TypeAttributInterface
|
||||
{
|
||||
public function setType(string $type): void;
|
||||
|
||||
public function getType(): string;
|
||||
}
|
27
application/symfony/src/Entity/Attribut/UserAttribut.php
Normal file
27
application/symfony/src/Entity/Attribut/UserAttribut.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
use App\Entity\User;
|
||||
use App\Entity\UserInterface;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
trait UserAttribut
|
||||
{
|
||||
/**
|
||||
* @var User
|
||||
*/
|
||||
protected $user;
|
||||
|
||||
public function setUser(UserInterface $user): void
|
||||
{
|
||||
$this->user = $user;
|
||||
}
|
||||
|
||||
public function getUser(): UserInterface
|
||||
{
|
||||
return $this->user;
|
||||
}
|
||||
}
|
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
use App\Entity\UserInterface;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
interface UserAttributInterface
|
||||
{
|
||||
public function setUser(UserInterface $user): void;
|
||||
|
||||
public function getUser(): UserInterface;
|
||||
}
|
24
application/symfony/src/Entity/Attribut/VersionAttribut.php
Normal file
24
application/symfony/src/Entity/Attribut/VersionAttribut.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
trait VersionAttribut
|
||||
{
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
protected $version;
|
||||
|
||||
public function setVersion(int $version): void
|
||||
{
|
||||
$this->version = $version;
|
||||
}
|
||||
|
||||
public function getVersion(): int
|
||||
{
|
||||
return $this->version;
|
||||
}
|
||||
}
|
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
/**
|
||||
* Entities which implement this interface can lock stuff on an optimistic base.
|
||||
*
|
||||
* @see https://www.doctrine-project.org/projects/doctrine-orm/en/2.6/reference/transactions-and-concurrency.html
|
||||
* @see https://en.wikipedia.org/wiki/Optimistic_concurrency_control
|
||||
*
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
interface VersionAttributInterface
|
||||
{
|
||||
/**
|
||||
* Returns the revision version of the entity.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getVersion(): int;
|
||||
|
||||
/**
|
||||
* Sets the revision version of the entity.
|
||||
*
|
||||
* @param int $version
|
||||
*/
|
||||
public function setVersion(int $version): void;
|
||||
}
|
19
application/symfony/src/Entity/EntityInterface.php
Normal file
19
application/symfony/src/Entity/EntityInterface.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Entity\Attribut\VersionAttributInterface;
|
||||
use App\Entity\Attribut\IdAttributInterface;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
interface EntityInterface extends VersionAttributInterface, IdAttributInterface
|
||||
{
|
||||
/**
|
||||
* Allows easier debuging.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString(): string;
|
||||
}
|
21
application/symfony/src/Entity/Meta/AbstractMeta.php
Normal file
21
application/symfony/src/Entity/Meta/AbstractMeta.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Meta;
|
||||
|
||||
use App\Entity\AbstractEntity;
|
||||
use App\Entity\Attribut\SourceAttribut;
|
||||
|
||||
/**
|
||||
* @todo Implement source attribut
|
||||
*
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
abstract class AbstractMeta extends AbstractEntity implements MetaInterface
|
||||
{
|
||||
use SourceAttribut;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
}
|
49
application/symfony/src/Entity/Meta/Law.php
Normal file
49
application/symfony/src/Entity/Meta/Law.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Meta;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use App\Entity\Attribut\RightsAttribute;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use App\Entity\Attribut\RelationAttribut;
|
||||
use App\Entity\Source\SourceInterface;
|
||||
use App\Entity\Attribut\GrantAttribut;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
* @ORM\Table(name="meta_law")
|
||||
* @ORM\Entity(repositoryClass="App\Repository\LawRepository")
|
||||
*/
|
||||
class Law extends AbstractMeta implements LawInterface
|
||||
{
|
||||
use RightsAttribute, RelationAttribut, GrantAttribut;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="boolean",name="`grant`")
|
||||
*
|
||||
* @var bool the standart grant value
|
||||
*/
|
||||
protected $grant;
|
||||
|
||||
/**
|
||||
* @ORM\OneToOne(targetEntity="App\Entity\Source\AbstractSource",cascade={"persist", "remove"})
|
||||
* @ORM\JoinColumn(name="source_id", referencedColumnName="id",onDelete="CASCADE")
|
||||
*
|
||||
* @var SourceInterface
|
||||
*/
|
||||
protected $source;
|
||||
|
||||
/**
|
||||
* @ORM\OneToMany(targetEntity="Right", mappedBy="law", cascade={"persist", "remove"})
|
||||
*
|
||||
* @var ArrayCollection | Right[]
|
||||
*/
|
||||
protected $rights;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->rights = new ArrayCollection();
|
||||
$this->grant = false;
|
||||
}
|
||||
}
|
13
application/symfony/src/Entity/Meta/LawInterface.php
Normal file
13
application/symfony/src/Entity/Meta/LawInterface.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Meta;
|
||||
|
||||
use App\Entity\Attribut\RightsAttributInterface;
|
||||
use App\Entity\Attribut\GrantAttributInterface;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
interface LawInterface extends RightsAttributInterface, MetaInterface, GrantAttributInterface
|
||||
{
|
||||
}
|
16
application/symfony/src/Entity/Meta/MetaInterface.php
Normal file
16
application/symfony/src/Entity/Meta/MetaInterface.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Meta;
|
||||
|
||||
use App\Entity\EntityInterface;
|
||||
use App\Entity\Attribut\SourceAttributInterface;
|
||||
|
||||
/**
|
||||
* Meta entities contain informations which describe sources.
|
||||
* If you refer from a meta entity to an source be aware to catch infinite loops!
|
||||
*
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
interface MetaInterface extends EntityInterface, SourceAttributInterface
|
||||
{
|
||||
}
|
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Meta\Relation;
|
||||
|
||||
use App\Entity\Meta\AbstractMeta;
|
||||
use App\Entity\Source\SourceInterface;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
abstract class AbstractRelation extends AbstractMeta implements RelationInterface
|
||||
{
|
||||
/**
|
||||
* @ORM\OneToOne(targetEntity="App\Entity\Source\AbstractSource",cascade={"persist", "remove"})
|
||||
* @ORM\JoinColumn(name="source_id", referencedColumnName="id",onDelete="CASCADE")
|
||||
*
|
||||
* @var SourceInterface
|
||||
*/
|
||||
protected $source;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
}
|
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Meta\Relation\Member;
|
||||
|
||||
use App\Entity\Meta\Relation\AbstractRelation;
|
||||
use App\Entity\Attribut\MembersAttribut;
|
||||
use App\Entity\Attribut\MembershipsAttribut;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
* @ORM\Entity()
|
||||
*/
|
||||
class MemberRelation extends AbstractRelation implements MemberRelationInterface
|
||||
{
|
||||
use MembersAttribut,MembershipsAttribut;
|
||||
|
||||
/**
|
||||
* Many Sources have many Source Members.
|
||||
*
|
||||
* @var Collection|MemberRelationInterface[]
|
||||
* @ORM\ManyToMany(targetEntity="MemberRelation", inversedBy="memberships",cascade={"persist", "remove"})
|
||||
* @ORM\JoinTable(name="source_members",
|
||||
* joinColumns={@ORM\JoinColumn(name="source_id", referencedColumnName="id",onDelete="CASCADE")},
|
||||
* inverseJoinColumns={@ORM\JoinColumn(name="member_id", referencedColumnName="id",onDelete="CASCADE")}
|
||||
* )
|
||||
*/
|
||||
protected $members;
|
||||
|
||||
/**
|
||||
* @var Collection|MemberRelationInterface[]
|
||||
* @ORM\ManyToMany(targetEntity="MemberRelation",mappedBy="members")
|
||||
*/
|
||||
protected $memberships;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->members = new ArrayCollection();
|
||||
$this->memberships = new ArrayCollection();
|
||||
}
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Meta\Relation\Member;
|
||||
|
||||
use App\Entity\Meta\Relation\RelationInterface;
|
||||
use App\Entity\Attribut\MembersAttributInterface;
|
||||
use App\Entity\Attribut\MembershipsAttributInterface;
|
||||
|
||||
interface MemberRelationInterface extends RelationInterface, MembersAttributInterface, MembershipsAttributInterface
|
||||
{
|
||||
}
|
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Meta\Relation\Parent;
|
||||
|
||||
use App\Entity\Attribut\IdAttribut;
|
||||
use App\Entity\Attribut\ParentsAttribut;
|
||||
use App\Entity\Attribut\ChildsAttribut;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use App\Entity\Meta\Relation\AbstractRelation;
|
||||
|
||||
/**
|
||||
* This class represents a relation.
|
||||
*
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
abstract class AbstractParentRelation extends AbstractRelation implements ParentRelationInterface
|
||||
{
|
||||
use IdAttribut,
|
||||
ParentsAttribut,
|
||||
ChildsAttribut;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->parents = new ArrayCollection();
|
||||
$this->childs = new ArrayCollection();
|
||||
}
|
||||
}
|
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Meta\Relation\Parent;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
* @ORM\Entity()
|
||||
*/
|
||||
class CreatorRelation extends AbstractParentRelation implements CreatorRelationInterface
|
||||
{
|
||||
/**
|
||||
* @ORM\ManyToMany(targetEntity="CreatorRelation",mappedBy="childs")
|
||||
*
|
||||
* @var Collection|CreatorRelationInterface[]
|
||||
*/
|
||||
protected $parents;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToMany(targetEntity="CreatorRelation",inversedBy="parents")
|
||||
* @ORM\JoinTable(name="meta_relation_childs",
|
||||
* joinColumns={@ORM\JoinColumn(name="relation_id", referencedColumnName="id")},
|
||||
* inverseJoinColumns={@ORM\JoinColumn(name="child_id", referencedColumnName="id")}
|
||||
* )
|
||||
*
|
||||
* @var Collection|CreatorRelationInterface[]
|
||||
*/
|
||||
protected $childs;
|
||||
}
|
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Meta\Relation\Parent;
|
||||
|
||||
use App\Entity\Meta\Relation\RelationInterface;
|
||||
|
||||
interface CreatorRelationInterface extends RelationInterface
|
||||
{
|
||||
}
|
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Meta\Relation\Parent;
|
||||
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
* @ORM\Entity()
|
||||
*/
|
||||
class HeredityRelation extends AbstractParentRelation implements HeredityRelationInterface
|
||||
{
|
||||
/**
|
||||
* Parents represent from which inhieres.
|
||||
*
|
||||
* @ORM\ManyToMany(targetEntity="HeredityRelation",mappedBy="childs")
|
||||
*
|
||||
* @var Collection|HeredityRelationInterface[]
|
||||
*/
|
||||
protected $parents;
|
||||
|
||||
/**
|
||||
* Childs represent the by the object produced relations.
|
||||
*
|
||||
* @ORM\ManyToMany(targetEntity="HeredityRelation",inversedBy="parents")
|
||||
* @ORM\JoinTable(
|
||||
* joinColumns={
|
||||
* @ORM\JoinColumn(name="relation_id", referencedColumnName="id")},
|
||||
* inverseJoinColumns={@ORM\JoinColumn(name="child_id", referencedColumnName="id")}
|
||||
* )
|
||||
*
|
||||
* @var Collection|HeredityRelationInterface[]
|
||||
*/
|
||||
protected $childs;
|
||||
}
|
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Meta\Relation\Parent;
|
||||
|
||||
interface HeredityRelationInterface extends ParentRelationInterface
|
||||
{
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Meta\Relation\Parent;
|
||||
|
||||
use App\Entity\Attribut\ParentsAttributInterface;
|
||||
use App\Entity\Attribut\ChildsAttributeInterface;
|
||||
use App\Entity\Meta\Relation\RelationInterface;
|
||||
|
||||
interface ParentRelationInterface extends RelationInterface, ParentsAttributInterface, ChildsAttributeInterface
|
||||
{
|
||||
}
|
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Meta\Relation;
|
||||
|
||||
use App\Entity\Meta\MetaInterface;
|
||||
|
||||
/**
|
||||
* Describes a relation of a source to another source.
|
||||
*
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
interface RelationInterface extends MetaInterface
|
||||
{
|
||||
}
|
115
application/symfony/src/Entity/Meta/Right.php
Normal file
115
application/symfony/src/Entity/Meta/Right.php
Normal file
@@ -0,0 +1,115 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Meta;
|
||||
|
||||
use App\Entity\Attribut\TypeAttribut;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Fresh\DoctrineEnumBundle\Validator\Constraints as DoctrineAssert;
|
||||
use App\Entity\Attribut\LawAttribut;
|
||||
use App\DBAL\Types\Meta\Right\LayerType;
|
||||
use App\Entity\Attribut\GrantAttribut;
|
||||
use App\Logic\Operation\OperationInterface;
|
||||
use App\Entity\Attribut\ConditionAttribut;
|
||||
use App\Entity\Attribut\RecieverAttribut;
|
||||
use App\Entity\Attribut\LayerAttribut;
|
||||
use App\Entity\Attribut\RelationAttribut;
|
||||
use App\Entity\Attribut\PriorityAttribut;
|
||||
use App\Entity\Source\SourceInterface;
|
||||
use App\Exception\NoValidChoiceException;
|
||||
use App\DBAL\Types\Meta\Right\CRUDType;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
* @ORM\Table(name="meta_right")
|
||||
* @ORM\Entity(repositoryClass="App\Repository\RightRepository")
|
||||
*/
|
||||
class Right extends AbstractMeta implements RightInterface
|
||||
{
|
||||
use TypeAttribut,LawAttribut, RelationAttribut, GrantAttribut,ConditionAttribut,RecieverAttribut,LayerAttribut,PriorityAttribut;
|
||||
|
||||
/**
|
||||
* @ORM\OneToOne(targetEntity="App\Entity\Source\AbstractSource",cascade={"persist", "remove"})
|
||||
* @ORM\JoinColumn(name="source_id", referencedColumnName="id",onDelete="CASCADE")
|
||||
*
|
||||
* @var SourceInterface The requested source to which the law applies
|
||||
*/
|
||||
protected $source;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="integer")
|
||||
*
|
||||
* @var int which priority has the right in a roleset
|
||||
*/
|
||||
protected $priority;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="Law", inversedBy="rights")
|
||||
* @ORM\JoinColumn(name="law_id", referencedColumnName="id")
|
||||
*
|
||||
* @var LawInterface
|
||||
*/
|
||||
protected $law;
|
||||
|
||||
/**
|
||||
* @ORM\Column(name="layer", type="LayerType", nullable=false)
|
||||
* @DoctrineAssert\Enum(entity="App\DBAL\Types\Meta\Right\LayerType")
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $layer;
|
||||
|
||||
/**
|
||||
* @todo Test and implement it on an correct way!
|
||||
* @ORM\OneToOne(targetEntity="App\Entity\Source\AbstractSource",cascade={"persist"})
|
||||
* @ORM\JoinColumn(name="reciever_id", referencedColumnName="id",onDelete="CASCADE")
|
||||
*
|
||||
* @var SourceInterface
|
||||
*/
|
||||
protected $reciever;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="boolean",name="`grant`")
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $grant;
|
||||
|
||||
/**
|
||||
* @ORM\Column(name="type", type="CRUDType", nullable=false)
|
||||
* @DoctrineAssert\Enum(entity="App\DBAL\Types\Meta\Right\CRUDType")
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $type;
|
||||
|
||||
/**
|
||||
* @ORM\OneToOne(targetEntity="App\Entity\Source\Operation\AbstractOperation",cascade={"persist"})
|
||||
* @ORM\JoinColumn(name="operation_id", referencedColumnName="id",nullable=true)
|
||||
*
|
||||
* @var OperationInterface
|
||||
*/
|
||||
protected $condition;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->grant = true;
|
||||
$this->priority = 0;
|
||||
}
|
||||
|
||||
public function setType(string $type): void
|
||||
{
|
||||
if (!array_key_exists($type, CRUDType::getChoices())) {
|
||||
throw new NoValidChoiceException();
|
||||
}
|
||||
$this->type = $type;
|
||||
}
|
||||
|
||||
public function setLayer(string $layer): void
|
||||
{
|
||||
if (!array_key_exists($layer, LayerType::getChoices())) {
|
||||
throw new NoValidChoiceException();
|
||||
}
|
||||
$this->layer = $layer;
|
||||
}
|
||||
}
|
19
application/symfony/src/Entity/Meta/RightInterface.php
Normal file
19
application/symfony/src/Entity/Meta/RightInterface.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Meta;
|
||||
|
||||
use App\Entity\Attribut\TypeAttributInterface;
|
||||
use App\Entity\Attribut\LawAttributInterface;
|
||||
use App\Entity\Attribut\RecieverAttributInterface;
|
||||
use App\Entity\Attribut\GrantAttributInterface;
|
||||
use App\Entity\Attribut\ConditionAttributInterface;
|
||||
use App\Entity\Attribut\LayerAttributInterface;
|
||||
use App\Entity\Attribut\RelationAttributInterface;
|
||||
use App\Entity\Attribut\PriorityAttributInterface;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
interface RightInterface extends TypeAttributInterface, LawAttributInterface, GrantAttributInterface, RecieverAttributInterface, RelationAttributInterface, ConditionAttributInterface, LayerAttributInterface, MetaInterface, PriorityAttributInterface
|
||||
{
|
||||
}
|
103
application/symfony/src/Entity/Source/AbstractSource.php
Normal file
103
application/symfony/src/Entity/Source/AbstractSource.php
Normal file
@@ -0,0 +1,103 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Source;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use JMS\Serializer\Annotation\Exclude;
|
||||
use App\Entity\AbstractEntity;
|
||||
use App\Entity\Attribut\LawAttribut;
|
||||
use App\Entity\Meta\LawInterface;
|
||||
use App\Entity\Meta\Law;
|
||||
use App\Entity\Attribut\SlugAttribut;
|
||||
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
use App\Entity\Attribut\CreatorRelationAttribut;
|
||||
use App\Entity\Meta\Relation\Parent\CreatorRelationInterface;
|
||||
use App\Entity\Meta\Relation\Parent\CreatorRelation;
|
||||
use App\Entity\Attribut\MemberRelationAttribut;
|
||||
use App\Entity\Meta\Relation\Member\MemberRelation;
|
||||
use App\Entity\Meta\Relation\Member\MemberRelationInterface;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*
|
||||
* For the members\memberships attribut checkout:
|
||||
*
|
||||
* @todo Move parts of discriminator map to subclasses
|
||||
*
|
||||
* @see http://www.inanzzz.com/index.php/post/h0jt/bidirectional-many-to-many-cascade-remove-and-orphan-removal-operations-in-doctrine
|
||||
*
|
||||
* @ORM\Entity(repositoryClass="App\Repository\Source\SourceRepository")
|
||||
* @ORM\Table(name="source")
|
||||
* @ORM\InheritanceType("JOINED")
|
||||
* @ORM\DiscriminatorColumn(name="discr", type="string")
|
||||
* @ORM\DiscriminatorMap({
|
||||
* "pure" = "PureSource",
|
||||
* "text" = "App\Entity\Source\Primitive\Text\TextSource",
|
||||
* "operation"="App\Entity\Source\Operation\AbstractOperation",
|
||||
* "user" = "App\Entity\Source\Complex\UserSource",
|
||||
* "fullpersonname" = "App\Entity\Source\Complex\FullPersonNameSource",
|
||||
* "personidentitysource"="App\Entity\Source\Complex\PersonIdentitySource",
|
||||
* "fullpersonnamesource"="App\Entity\Source\Complex\FullPersonNameSource",
|
||||
* "member" = "App\Entity\Source\Complex\Collection\TreeCollectionSource",
|
||||
* "and" = "App\Entity\Source\Operation\AndOperation",
|
||||
* "nickname" = "App\Entity\Source\Primitive\Name\NicknameSource",
|
||||
* "firstname" = "App\Entity\Source\Primitive\Name\FirstNameSource",
|
||||
* "surname" = "App\Entity\Source\Primitive\Name\SurnameSource"
|
||||
* })
|
||||
* @UniqueEntity("slug",ignoreNull=true)
|
||||
*/
|
||||
abstract class AbstractSource extends AbstractEntity implements SourceInterface
|
||||
{
|
||||
use LawAttribut,SlugAttribut,CreatorRelationAttribut, MemberRelationAttribut;
|
||||
|
||||
/**
|
||||
* System slugs should be writen in UPPER CASES
|
||||
* Slugs which are defined by the user are checked via the assert.
|
||||
*
|
||||
* @ORM\Column(type="string",length=30,nullable=true,unique=true)
|
||||
* @Assert\Regex(pattern="/^[a-z]+$/")
|
||||
*
|
||||
* @todo Check out if a plugin can solve this purpose;
|
||||
*
|
||||
* @see https://github.com/Atlantic18/DoctrineExtensions/blob/master/doc/sluggable.md
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $slug;
|
||||
|
||||
/**
|
||||
* @var CreatorRelationInterface
|
||||
* @ORM\OneToOne(targetEntity="App\Entity\Meta\Relation\Parent\CreatorRelation",cascade={"persist", "remove"})
|
||||
* @ORM\JoinColumn(name="creator_relation_id", referencedColumnName="id", onDelete="CASCADE")
|
||||
* @Exclude
|
||||
*/
|
||||
protected $creatorRelation;
|
||||
|
||||
/**
|
||||
* @var MemberRelationInterface
|
||||
* @ORM\OneToOne(targetEntity="App\Entity\Meta\Relation\Member\MemberRelation",cascade={"persist", "remove"})
|
||||
* @ORM\JoinColumn(name="member_relation_id", referencedColumnName="id", onDelete="CASCADE")
|
||||
* @Exclude
|
||||
*/
|
||||
protected $memberRelation;
|
||||
|
||||
/**
|
||||
* @ORM\OneToOne(targetEntity="App\Entity\Meta\Law",cascade={"persist", "remove"})
|
||||
* @ORM\JoinColumn(name="law_id", referencedColumnName="id", onDelete="CASCADE")
|
||||
*
|
||||
* @var LawInterface
|
||||
*/
|
||||
protected $law;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->creatorRelation = new CreatorRelation();
|
||||
$this->creatorRelation->setSource($this);
|
||||
$this->memberRelation = new MemberRelation();
|
||||
$this->memberRelation->setSource($this);
|
||||
$this->law = new Law();
|
||||
$this->law->setSource($this);
|
||||
}
|
||||
}
|
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Source\Complex;
|
||||
|
||||
use App\Entity\Source\AbstractSource;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
abstract class AbstractComplexSource extends AbstractSource implements ComplexSourceInterface
|
||||
{
|
||||
}
|
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Source\Complex\Collection;
|
||||
|
||||
use App\Entity\Source\AbstractSource;
|
||||
use App\Entity\Attribut\CollectionAttribut;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use App\Entity\Source\SourceInterface;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
abstract class AbstractCollectionSource extends AbstractSource implements CollectionSourceInterface
|
||||
{
|
||||
use CollectionAttribut;
|
||||
|
||||
/**
|
||||
* @var Collection|SourceInterface[]
|
||||
* @ORM\ManyToMany(targetEntity="App\Entity\Source\AbstractSource")
|
||||
* @ORM\JoinTable(name="collection_source",
|
||||
* joinColumns={@ORM\JoinColumn(name="collection_id", referencedColumnName="id")},
|
||||
* inverseJoinColumns={@ORM\JoinColumn(name="source_id", referencedColumnName="id")}
|
||||
* )
|
||||
*/
|
||||
protected $collection;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->collection = new ArrayCollection();
|
||||
}
|
||||
}
|
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Source\Complex\Collection;
|
||||
|
||||
use App\Entity\Source\SourceInterface;
|
||||
use App\Entity\Attribut\CollectionAttributInterface;
|
||||
|
||||
interface CollectionSourceInterface extends SourceInterface, CollectionAttributInterface
|
||||
{
|
||||
}
|
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Source\Complex\Collection;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
* @ORM\Entity
|
||||
*/
|
||||
class TreeCollectionSource extends AbstractCollectionSource implements TreeCollectionSourceInterface
|
||||
{
|
||||
}
|
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Source\Complex\Collection;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
interface TreeCollectionSourceInterface extends CollectionSourceInterface
|
||||
{
|
||||
}
|
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Source\Complex;
|
||||
|
||||
use App\Entity\Source\SourceInterface;
|
||||
|
||||
/**
|
||||
* Complex sources contain out of one or more primitive sources.
|
||||
*
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
interface ComplexSourceInterface extends SourceInterface
|
||||
{
|
||||
}
|
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Source\Complex;
|
||||
|
||||
use App\Entity\Attribut\FirstNameSourceAttribut;
|
||||
use App\Entity\Attribut\SurnameSourceAttribut;
|
||||
use App\Entity\Source\Primitive\Name\SurnameSource;
|
||||
use App\Entity\Source\Primitive\Name\FirstNameSource;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use App\Entity\Source\Primitive\Name\SurnameSourceInterface;
|
||||
use App\Entity\Source\Primitive\Name\FirstNameSourceInterface;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
* @ORM\Entity()
|
||||
*/
|
||||
class FullPersonNameSource extends AbstractComplexSource implements FullPersonNameSourceInterface
|
||||
{
|
||||
use FirstNameSourceAttribut,SurnameSourceAttribut;
|
||||
|
||||
/**
|
||||
* @ORM\OneToOne(targetEntity="App\Entity\Source\Primitive\Name\SurnameSource",cascade={"persist", "remove"})
|
||||
* @ORM\JoinColumn(name="surname_id", referencedColumnName="id",onDelete="CASCADE")
|
||||
*
|
||||
* @var SurnameSourceInterface
|
||||
*/
|
||||
protected $surnameSource;
|
||||
|
||||
/**
|
||||
* @ORM\OneToOne(targetEntity="App\Entity\Source\Primitive\Name\FirstNameSource",cascade={"persist", "remove"})
|
||||
* @ORM\JoinColumn(name="firstname_id", referencedColumnName="id",onDelete="CASCADE")
|
||||
*
|
||||
* @var FirstNameSourceInterface
|
||||
*/
|
||||
protected $firstNameSource;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->surnameSource = new SurnameSource();
|
||||
$this->firstNameSource = new FirstNameSource();
|
||||
}
|
||||
}
|
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Source\Complex;
|
||||
|
||||
use App\Entity\Attribut\FirstNameSourceAttributInterface;
|
||||
use App\Entity\Attribut\SurnameSourceAttributInterface;
|
||||
|
||||
/**
|
||||
* @todo Maybe a middle name would be helpfull in the future ;)
|
||||
*
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
interface FullPersonNameSourceInterface extends ComplexSourceInterface, FirstNameSourceAttributInterface, SurnameSourceAttributInterface
|
||||
{
|
||||
}
|
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Source\Complex;
|
||||
|
||||
use App\Entity\Attribut\FullPersonNameSourceAttribut;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
* @ORM\Entity()
|
||||
*/
|
||||
class PersonIdentitySource extends AbstractComplexSource implements PersonIdentitySourceInterface
|
||||
{
|
||||
use FullPersonNameSourceAttribut;
|
||||
|
||||
/**
|
||||
* @ORM\OneToOne(targetEntity="FullPersonNameSource",cascade={"persist", "remove"})
|
||||
* @ORM\JoinColumn(name="fullname_id", referencedColumnName="id",onDelete="CASCADE")
|
||||
*
|
||||
* @var FullPersonNameSourceInterface
|
||||
*/
|
||||
protected $fullPersonNameSource;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->fullPersonNameSource = new FullPersonNameSource();
|
||||
}
|
||||
}
|
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Source\Complex;
|
||||
|
||||
use App\Entity\Attribut\FullPersonNameSourceAttributInterface;
|
||||
|
||||
interface PersonIdentitySourceInterface extends ComplexSourceInterface, FullPersonNameSourceAttributInterface
|
||||
{
|
||||
}
|
43
application/symfony/src/Entity/Source/Complex/UserSource.php
Normal file
43
application/symfony/src/Entity/Source/Complex/UserSource.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Source\Complex;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use App\Entity\Attribut\UserAttribut;
|
||||
use App\Entity\UserInterface;
|
||||
use App\Entity\Attribut\PersonIdentitySourceAttribut;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
* @ORM\Entity(repositoryClass="App\Repository\UserSourceRepository")
|
||||
*/
|
||||
class UserSource extends AbstractComplexSource implements UserSourceInterface
|
||||
{
|
||||
use UserAttribut,PersonIdentitySourceAttribut;
|
||||
|
||||
/**
|
||||
* @ORM\OneToOne(targetEntity="App\Entity\User",cascade={"persist", "remove"})
|
||||
* @ORM\JoinColumn(name="user_id", referencedColumnName="id",onDelete="CASCADE")
|
||||
*
|
||||
* @var UserInterface
|
||||
*/
|
||||
protected $user;
|
||||
|
||||
/**
|
||||
* @ORM\OneToOne(targetEntity="PersonIdentitySource",cascade={"persist", "remove"})
|
||||
* @ORM\JoinColumn(name="identity_id", referencedColumnName="id",onDelete="CASCADE")
|
||||
*
|
||||
* @var PersonIdentitySourceInterface
|
||||
*/
|
||||
protected $personIdentitySource;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function hasPersonIdentitySource(): bool
|
||||
{
|
||||
return isset($this->personIdentitySource);
|
||||
}
|
||||
}
|
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Source\Complex;
|
||||
|
||||
use App\Entity\Attribut\UserAttributInterface;
|
||||
use App\Entity\Attribut\PersonIdentitySourceAttributInterface;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
interface UserSourceInterface extends ComplexSourceInterface, UserAttributInterface, PersonIdentitySourceAttributInterface
|
||||
{
|
||||
/**
|
||||
* Checks if the user has an identity source.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function hasPersonIdentitySource(): bool;
|
||||
}
|
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Source\Operation;
|
||||
|
||||
use App\Logic\Result\ResultInterface;
|
||||
use App\Logic\Operation\OperandInterface;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use App\Entity\Source\AbstractSource;
|
||||
use App\Entity\Source\Operation\Attribut\OperandsAttribut;
|
||||
use App\Exception\NotProcessedException;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
* @ORM\Entity
|
||||
*/
|
||||
abstract class AbstractOperation extends AbstractSource implements OperationInterface
|
||||
{
|
||||
use OperandsAttribut;
|
||||
|
||||
/**
|
||||
* The result MUST NOT be saved via Doctrine!
|
||||
*
|
||||
* @var ResultInterface
|
||||
*/
|
||||
protected $result;
|
||||
|
||||
/**
|
||||
* @var ArrayCollection|OperandInterface[]
|
||||
*/
|
||||
protected $operands;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->operands = new ArrayCollection();
|
||||
}
|
||||
|
||||
public function getResult(): ResultInterface
|
||||
{
|
||||
if ($this->result) {
|
||||
return $this->result;
|
||||
}
|
||||
throw new NotProcessedException('No result was generated!');
|
||||
}
|
||||
}
|
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Source\Operation;
|
||||
|
||||
use App\Logic\Result\Result;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use App\Exception\NotDefinedException;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
* @ORM\Entity()
|
||||
*
|
||||
* @todo move to the logic level!
|
||||
*/
|
||||
class AndOperation extends AbstractOperation implements AndOperationInterface
|
||||
{
|
||||
public function process(): void
|
||||
{
|
||||
if ($this->operands->isEmpty()) {
|
||||
throw new NotDefinedException('Operands must be defined!');
|
||||
}
|
||||
$this->result = new Result();
|
||||
/*
|
||||
* @var OperandInterface
|
||||
*/
|
||||
foreach ($this->operands->toArray() as $operand) {
|
||||
if (!$operand->getResult()->getBool()) {
|
||||
$this->result->setAll(false);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
$this->result->setAll(true);
|
||||
}
|
||||
}
|
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Source\Operation;
|
||||
|
||||
interface AndOperationInterface extends OperationInterface
|
||||
{
|
||||
}
|
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Source\Operation\Attribut;
|
||||
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
|
||||
trait OperandsAttribut
|
||||
{
|
||||
/**
|
||||
* @var Collection
|
||||
*/
|
||||
protected $operands;
|
||||
|
||||
/**
|
||||
* @param Collection $collection
|
||||
*/
|
||||
public function setOperands(Collection $operands): void
|
||||
{
|
||||
$this->operands = $operands;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection
|
||||
*/
|
||||
public function getOperands(): Collection
|
||||
{
|
||||
return $this->operands;
|
||||
}
|
||||
}
|
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Source\Operation\Attribut;
|
||||
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
|
||||
interface OperandsAttributInterface
|
||||
{
|
||||
/**
|
||||
* @param Collection $collection
|
||||
*/
|
||||
public function setOperands(Collection $operands): void;
|
||||
|
||||
/**
|
||||
* @return Collection
|
||||
*/
|
||||
public function getOperands(): Collection;
|
||||
}
|
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Source\Operation;
|
||||
|
||||
use App\Entity\Source\Operation\Attribut\OperandsAttributInterface;
|
||||
use App\Logic\Operation\OperationInterface as OperationInterfaceOrigine;
|
||||
|
||||
interface OperationInterface extends OperandsAttributInterface, OperationInterfaceOrigine
|
||||
{
|
||||
}
|
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Source\Primitive;
|
||||
|
||||
use App\Entity\Source\AbstractSource;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
abstract class AbstractPrimitiveSource extends AbstractSource implements PrimitiveSourceInterface
|
||||
{
|
||||
}
|
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity\Source\Primitive\Name;
|
||||
|
||||
use App\Entity\Source\Primitive\AbstractPrimitiveSource;
|
||||
use App\Entity\Attribut\NameAttribut;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
class AbstractNameSource extends AbstractPrimitiveSource implements NameSourceInterface
|
||||
{
|
||||
use NameAttribut;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string",length=255)
|
||||
* @Assert\NotBlank()
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $name;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user