mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-09-29 21:08:13 +02:00
Optimized for SPA
This commit is contained in:
@@ -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
|
||||
{
|
||||
}
|
Reference in New Issue
Block a user