From 3d42526698a166b4083b1e677730e2badd0764cf Mon Sep 17 00:00:00 2001 From: Kevin Frantz Date: Thu, 6 Sep 2018 13:52:34 +0200 Subject: [PATCH] Optimized Entity draft --- application/src/Entity/AbstractSource.php | 1 + .../{attribut => Attribut}/IdAttribut.php | 2 +- .../IdAttributInterface.php | 2 +- .../{attribut => Attribut}/NodeAttribut.php | 4 +- .../NodeAttributInterface.php | 2 +- .../src/Entity/Attribut/ParentAttribut.php | 29 +++++++++++++++ .../Attribut/ParentsAttributInterface.php | 17 +++++++++ .../{attribut => Attribut}/SourceAttribut.php | 2 +- .../SourceAttributInterface.php | 2 +- .../src/Entity/ConfigurationInterface.php | 2 +- application/src/Entity/Node.php | 37 ++----------------- application/src/Entity/NodeInterface.php | 14 +++---- application/src/Entity/Property.php | 2 +- 13 files changed, 66 insertions(+), 50 deletions(-) rename application/src/Entity/{attribut => Attribut}/IdAttribut.php (92%) rename application/src/Entity/{attribut => Attribut}/IdAttributInterface.php (84%) rename application/src/Entity/{attribut => Attribut}/NodeAttribut.php (73%) rename application/src/Entity/{attribut => Attribut}/NodeAttributInterface.php (87%) create mode 100644 application/src/Entity/Attribut/ParentAttribut.php create mode 100644 application/src/Entity/Attribut/ParentsAttributInterface.php rename application/src/Entity/{attribut => Attribut}/SourceAttribut.php (92%) rename application/src/Entity/{attribut => Attribut}/SourceAttributInterface.php (88%) diff --git a/application/src/Entity/AbstractSource.php b/application/src/Entity/AbstractSource.php index c417aba..3a06fc4 100644 --- a/application/src/Entity/AbstractSource.php +++ b/application/src/Entity/AbstractSource.php @@ -7,6 +7,7 @@ use App\Entity\attribut\NodeAttribut; /** * * @author kevinfrantz + * @see https://www.doctrine-project.org/projects/doctrine-orm/en/2.6/reference/inheritance-mapping.html * */ abstract class AbstractSource implements SourceInterface diff --git a/application/src/Entity/attribut/IdAttribut.php b/application/src/Entity/Attribut/IdAttribut.php similarity index 92% rename from application/src/Entity/attribut/IdAttribut.php rename to application/src/Entity/Attribut/IdAttribut.php index c4af5ca..2e31319 100644 --- a/application/src/Entity/attribut/IdAttribut.php +++ b/application/src/Entity/Attribut/IdAttribut.php @@ -1,5 +1,5 @@ parents; + } + + public function setParents(ArrayCollection $parents): void + { + $this->parents = $parents; + } +} + diff --git a/application/src/Entity/Attribut/ParentsAttributInterface.php b/application/src/Entity/Attribut/ParentsAttributInterface.php new file mode 100644 index 0000000..59dfdc9 --- /dev/null +++ b/application/src/Entity/Attribut/ParentsAttributInterface.php @@ -0,0 +1,17 @@ +