diff --git a/application/src/Entity/Meta/AbstractMeta.php b/application/src/Entity/Meta/AbstractMeta.php index d23cce2..8549eaf 100644 --- a/application/src/Entity/Meta/AbstractMeta.php +++ b/application/src/Entity/Meta/AbstractMeta.php @@ -4,8 +4,6 @@ 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 @@ -16,14 +14,6 @@ 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/Law.php b/application/src/Entity/Meta/Law.php index 7077621..d2121f9 100644 --- a/application/src/Entity/Meta/Law.php +++ b/application/src/Entity/Meta/Law.php @@ -6,6 +6,7 @@ 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; /** * @author kevinfrantz @@ -16,6 +17,14 @@ class Law extends AbstractMeta implements LawInterface { use RightsAttribute, RelationAttribut; + /** + * @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"}) * diff --git a/application/src/Entity/Meta/Relation/Parent/CreatorRelation.php b/application/src/Entity/Meta/Relation/Parent/CreatorRelation.php index d9d8f87..05047ca 100644 --- a/application/src/Entity/Meta/Relation/Parent/CreatorRelation.php +++ b/application/src/Entity/Meta/Relation/Parent/CreatorRelation.php @@ -5,6 +5,7 @@ namespace App\Entity\Meta\Relation\Parent; use Doctrine\ORM\Mapping as ORM; use Doctrine\Common\Collections\Collection; use App\Entity\Meta\Relation\CreatorRelationInterface; +use App\Entity\Source\SourceInterface; /** * @author kevinfrantz @@ -12,6 +13,14 @@ use App\Entity\Meta\Relation\CreatorRelationInterface; */ class CreatorRelation extends AbstractParentRelation { + /** + * @ORM\OneToOne(targetEntity="App\Entity\Source\AbstractSource",cascade={"persist", "remove"}) + * @ORM\JoinColumn(name="source_id", referencedColumnName="id",onDelete="CASCADE") + * + * @var SourceInterface + */ + protected $source; + /** * @ORM\ManyToMany(targetEntity="CreatorRelation",mappedBy="childs") * diff --git a/application/src/Entity/Source/AbstractSource.php b/application/src/Entity/Source/AbstractSource.php index 5902ee5..e05c0e4 100644 --- a/application/src/Entity/Source/AbstractSource.php +++ b/application/src/Entity/Source/AbstractSource.php @@ -88,7 +88,7 @@ abstract class AbstractSource extends AbstractEntity implements SourceInterface /** * @ORM\OneToOne(targetEntity="App\Entity\Meta\Law",cascade={"persist", "remove"}) - * @ORM\JoinColumn(name="law_id", referencedColumnName="id") + * @ORM\JoinColumn(name="law_id", referencedColumnName="id", onDelete="CASCADE") * * @var LawInterface */