From d1b7e0f070fd14ec23bd8e64913500a5700869d7 Mon Sep 17 00:00:00 2001 From: Kevin Frantz Date: Thu, 13 Sep 2018 12:29:07 +0200 Subject: [PATCH] Optimized entities --- application/src/Entity/AbstractSource.php | 7 ++- .../src/Entity/Attribut/NodeAttribut.php | 2 +- application/src/Entity/Configuration.php | 48 ------------------- .../src/Entity/ConfigurationInterface.php | 23 --------- application/src/Entity/Property.php | 29 ----------- application/src/Entity/PropertyInterface.php | 15 ------ application/src/Entity/User.php | 1 + 7 files changed, 5 insertions(+), 120 deletions(-) delete mode 100644 application/src/Entity/Configuration.php delete mode 100644 application/src/Entity/ConfigurationInterface.php delete mode 100644 application/src/Entity/Property.php delete mode 100644 application/src/Entity/PropertyInterface.php diff --git a/application/src/Entity/AbstractSource.php b/application/src/Entity/AbstractSource.php index 2739ca0..7edb587 100644 --- a/application/src/Entity/AbstractSource.php +++ b/application/src/Entity/AbstractSource.php @@ -19,8 +19,7 @@ abstract class AbstractSource implements SourceInterface { use IdAttribut,NodeAttribut; - /** - * @var ConfigurationInterface - */ - protected $configuration; + public function __construct(){ + $this->node = new Node(); + } } diff --git a/application/src/Entity/Attribut/NodeAttribut.php b/application/src/Entity/Attribut/NodeAttribut.php index 5562730..a0cb5fc 100644 --- a/application/src/Entity/Attribut/NodeAttribut.php +++ b/application/src/Entity/Attribut/NodeAttribut.php @@ -11,7 +11,7 @@ trait NodeAttribut { /** * @var NodeInterface - * @ORM\OneToOne(targetEntity="Node") + * @ORM\OneToOne(targetEntity="Node",cascade={"persist", "remove"}) * @ORM\JoinColumn(name="node_id", referencedColumnName="id") */ protected $node; diff --git a/application/src/Entity/Configuration.php b/application/src/Entity/Configuration.php deleted file mode 100644 index 1e209f9..0000000 --- a/application/src/Entity/Configuration.php +++ /dev/null @@ -1,48 +0,0 @@ -isActive = true; + $this->node = new Node(); } }