From b292082c1f1bb8ee5849788491c38955833cf2a5 Mon Sep 17 00:00:00 2001 From: Kevin Frantz Date: Sun, 4 Nov 2018 11:53:36 +0100 Subject: [PATCH] Added Data Source draft --- .../{UsersFixtures.php => DummyFixtures.php} | 9 +++++++-- .../src/Entity/Source/Data/AbstractDataSource.php | 9 +++++++++ .../src/Entity/Source/Data/DataSourceInterface.php | 9 +++++++++ .../src/Entity/Source/{ => Data}/NameSource.php | 4 ++-- .../src/Entity/Source/Data/NameSourceInterface.php | 12 ++++++++++++ .../src/Entity/Source/{ => Data}/UserSource.php | 4 ++-- .../src/Entity/Source/Data/UserSourceInterface.php | 14 ++++++++++++++ .../src/Entity/Source/NameSourceInterface.php | 12 ------------ .../src/Entity/Source/UserSourceInterface.php | 13 ------------- 9 files changed, 55 insertions(+), 31 deletions(-) rename application/src/DataFixtures/{UsersFixtures.php => DummyFixtures.php} (64%) create mode 100644 application/src/Entity/Source/Data/AbstractDataSource.php create mode 100644 application/src/Entity/Source/Data/DataSourceInterface.php rename application/src/Entity/Source/{ => Data}/NameSource.php (82%) create mode 100644 application/src/Entity/Source/Data/NameSourceInterface.php rename application/src/Entity/Source/{ => Data}/UserSource.php (90%) create mode 100644 application/src/Entity/Source/Data/UserSourceInterface.php delete mode 100644 application/src/Entity/Source/NameSourceInterface.php delete mode 100644 application/src/Entity/Source/UserSourceInterface.php diff --git a/application/src/DataFixtures/UsersFixtures.php b/application/src/DataFixtures/DummyFixtures.php similarity index 64% rename from application/src/DataFixtures/UsersFixtures.php rename to application/src/DataFixtures/DummyFixtures.php index acb7588..9e190c4 100644 --- a/application/src/DataFixtures/UsersFixtures.php +++ b/application/src/DataFixtures/DummyFixtures.php @@ -6,7 +6,12 @@ use Doctrine\Bundle\FixturesBundle\Fixture; use Doctrine\Common\Persistence\ObjectManager; use App\Entity\User; -class UsersFixtures extends Fixture +/** + * Never execute this fixture on a livesystem! + * @author kevinfrantz + * + */ +class DummyFixtures extends Fixture { public function load(ObjectManager $manager) { @@ -15,6 +20,6 @@ class UsersFixtures extends Fixture public function adminUser() { $admin = new User(); - $admin->getSource(); + $source = $admin->getSource(); } } diff --git a/application/src/Entity/Source/Data/AbstractDataSource.php b/application/src/Entity/Source/Data/AbstractDataSource.php new file mode 100644 index 0000000..176ca44 --- /dev/null +++ b/application/src/Entity/Source/Data/AbstractDataSource.php @@ -0,0 +1,9 @@ +