diff --git a/application/src/Entity/Meta/AbstractMeta.php b/application/src/Entity/Meta/AbstractMeta.php index 9958107..d23cce2 100644 --- a/application/src/Entity/Meta/AbstractMeta.php +++ b/application/src/Entity/Meta/AbstractMeta.php @@ -3,12 +3,27 @@ namespace App\Entity\Meta; use App\Entity\AbstractEntity; +use App\Entity\Attribut\SourceAttribut; +use App\Entity\Source\SourceInterface; +use Doctrine\ORM\Mapping as ORM; /** + * @todo Implement source attribut + * * @author kevinfrantz */ abstract class AbstractMeta extends AbstractEntity implements MetaInterface { + use SourceAttribut; + + /** + * @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(); diff --git a/application/src/Entity/Meta/MetaInterface.php b/application/src/Entity/Meta/MetaInterface.php index 9caf7a5..a747647 100644 --- a/application/src/Entity/Meta/MetaInterface.php +++ b/application/src/Entity/Meta/MetaInterface.php @@ -3,6 +3,7 @@ namespace App\Entity\Meta; use App\Entity\EntityInterface; +use App\Entity\Attribut\SourceAttributInterface; /** * Meta entities contain informations which describe sources. @@ -10,6 +11,6 @@ use App\Entity\EntityInterface; * * @author kevinfrantz */ -interface MetaInterface extends EntityInterface +interface MetaInterface extends EntityInterface, SourceAttributInterface { } diff --git a/application/src/Entity/Meta/Relation.php b/application/src/Entity/Meta/Relation.php deleted file mode 100644 index 9f7be55..0000000 --- a/application/src/Entity/Meta/Relation.php +++ /dev/null @@ -1,78 +0,0 @@ -law = new Law(); - $this->parents = new ArrayCollection(); - $this->childs = new ArrayCollection(); - } -} diff --git a/application/src/Entity/Meta/Relation/AbstractRelation.php b/application/src/Entity/Meta/Relation/AbstractRelation.php new file mode 100644 index 0000000..cfd97fd --- /dev/null +++ b/application/src/Entity/Meta/Relation/AbstractRelation.php @@ -0,0 +1,16 @@ +parents = new ArrayCollection(); + $this->childs = new ArrayCollection(); + } +} diff --git a/application/src/Entity/Meta/Relation/Parent/CreatorRelation.php b/application/src/Entity/Meta/Relation/Parent/CreatorRelation.php new file mode 100644 index 0000000..79c0d10 --- /dev/null +++ b/application/src/Entity/Meta/Relation/Parent/CreatorRelation.php @@ -0,0 +1,28 @@ +