From 7734f57c63b8d5abb617212f2127456a49b3c3f1 Mon Sep 17 00:00:00 2001 From: Kevin Frantz Date: Thu, 25 Oct 2018 22:35:11 +0200 Subject: [PATCH] Simpliefied SourceSources --- .../src/Entity/Source/AbstractSource.php | 2 +- .../Source/Attribut/SourceMembersAttribut.php | 26 --- .../Source/Attribut/SourcesAttribut.php | 30 +++ ...rface.php => SourcesAttributInterface.php} | 10 +- .../src/Entity/Source/SourceCollection.php | 176 ------------------ .../Source/SourceCollectionInterface.php | 107 ----------- .../src/Entity/Source/SourcesSource.php | 26 +++ .../Entity/Source/SourcesSourceInterface.php | 15 ++ 8 files changed, 75 insertions(+), 317 deletions(-) delete mode 100644 application/src/Entity/Source/Attribut/SourceMembersAttribut.php create mode 100644 application/src/Entity/Source/Attribut/SourcesAttribut.php rename application/src/Entity/Source/Attribut/{SourceMembersAttributInterface.php => SourcesAttributInterface.php} (53%) delete mode 100644 application/src/Entity/Source/SourceCollection.php delete mode 100644 application/src/Entity/Source/SourceCollectionInterface.php create mode 100644 application/src/Entity/Source/SourcesSource.php create mode 100644 application/src/Entity/Source/SourcesSourceInterface.php diff --git a/application/src/Entity/Source/AbstractSource.php b/application/src/Entity/Source/AbstractSource.php index 364ae1b..9702f62 100644 --- a/application/src/Entity/Source/AbstractSource.php +++ b/application/src/Entity/Source/AbstractSource.php @@ -17,7 +17,7 @@ use App\Entity\Node; * @ORM\Table(name="source") * @ORM\InheritanceType("JOINED") * @ORM\DiscriminatorColumn(name="discr", type="string") - * @ORM\DiscriminatorMap({"user" = "UserSource","name" = "NameSource","collection" = "SourceCollection"}) + * @ORM\DiscriminatorMap({"user" = "UserSource","name" = "NameSource","collection" = "SourcesSource"}) */ abstract class AbstractSource extends AbstractEntity implements SourceInterface { diff --git a/application/src/Entity/Source/Attribut/SourceMembersAttribut.php b/application/src/Entity/Source/Attribut/SourceMembersAttribut.php deleted file mode 100644 index 075cc19..0000000 --- a/application/src/Entity/Source/Attribut/SourceMembersAttribut.php +++ /dev/null @@ -1,26 +0,0 @@ -members; - } - - public function setMembers(Collection $members):void{ - $this->members = $members; - } -} - diff --git a/application/src/Entity/Source/Attribut/SourcesAttribut.php b/application/src/Entity/Source/Attribut/SourcesAttribut.php new file mode 100644 index 0000000..c26d275 --- /dev/null +++ b/application/src/Entity/Source/Attribut/SourcesAttribut.php @@ -0,0 +1,30 @@ +sources; + } + + public function setSources(Collection $sources): void + { + $this->sources = $sources; + } +} + diff --git a/application/src/Entity/Source/Attribut/SourceMembersAttributInterface.php b/application/src/Entity/Source/Attribut/SourcesAttributInterface.php similarity index 53% rename from application/src/Entity/Source/Attribut/SourceMembersAttributInterface.php rename to application/src/Entity/Source/Attribut/SourcesAttributInterface.php index 0bd7ca6..39f5bcd 100644 --- a/application/src/Entity/Source/Attribut/SourceMembersAttributInterface.php +++ b/application/src/Entity/Source/Attribut/SourcesAttributInterface.php @@ -9,21 +9,17 @@ use Doctrine\Common\Collections\Collection; * @author kevinfrantz * */ -interface SourceMembersAttributInterface +interface SourcesAttributInterface { /** - * Sets the collection source members - * * @param Collection $members */ - public function setMembers(Collection $members): void; + public function setSources(Collection $sources): void; /** - * Returns the collection source members - * * @return Collection */ - public function getMembers(): Collection; + public function getSources(): Collection; } diff --git a/application/src/Entity/Source/SourceCollection.php b/application/src/Entity/Source/SourceCollection.php deleted file mode 100644 index 53a0c0e..0000000 --- a/application/src/Entity/Source/SourceCollection.php +++ /dev/null @@ -1,176 +0,0 @@ -members->next(); - } - - public function forAll(Closure $p) - { - return $this->members->forAll($p); - } - - public function remove($key) - { - return $this->members->remove($key); - } - - public function current() - { - return $this->members->current(); - } - - public function partition(Closure $p) - { - return $this->members->partition($p); - } - - public function offsetExists($offset) - { - return $this->offsetExists($offset); - } - - public function slice($offset, $length = null) - { - return $this->slice($offset, $length); - } - - public function get($key) - { - return $this->members->get($key); - } - - public function offsetUnset($offset) - { - return $this->members->offsetUnset($offset); - } - - public function toArray() - { - return $this->members->toArray(); - } - - public function map(Closure $func) - { - return $this->members->map($func); - } - - public function indexOf($element) - { - return $this->members->indexOf($element); - } - - public function key() - { - return $this->members->key(); - } - - public function add($element) - { - return $this->add($element); - } - - public function offsetGet($offset) - { - return $this->members->offsetGet($offset); - } - - public function set($key, $value) - { - return $this->members->set($key, $value); - } - - public function getValues() - { - return $this->members->getValues(); - } - - public function last() - { - return $this->members->last(); - } - - public function containsKey($key) - { - return $this->members->containsKey($key); - } - - public function clear() - { - return $this->members->clear(); - } - - public function isEmpty() - { - return $this->members->isEmpty(); - } - - public function count() - { - return $this->members->count(); - } - - public function getKeys() - { - return $this->members->getKeys(); - } - - public function offsetSet($offset, $value) - { - return $this->members->offsetSet($offset, $value); - } - - public function filter(Closure $p) - { - return $this->members->filter($p); - } - - public function contains($element) - { - return $this->members->contains($element); - } - - public function getIterator() - { - return $this->members->getIterator(); - } - - public function exists(Closure $p) - { - return $this->members->exists($p); - } - - public function removeElement($element) - { - return $this->members->removeElement($element); - } - - public function first() - { - return $this->members->first(); - } -} - diff --git a/application/src/Entity/Source/SourceCollectionInterface.php b/application/src/Entity/Source/SourceCollectionInterface.php deleted file mode 100644 index d4de89a..0000000 --- a/application/src/Entity/Source/SourceCollectionInterface.php +++ /dev/null @@ -1,107 +0,0 @@ -