Added Data Source draft

This commit is contained in:
Kevin Frantz 2018-11-04 11:53:36 +01:00
parent 1286717495
commit b292082c1f
9 changed files with 55 additions and 31 deletions

View File

@ -6,7 +6,12 @@ use Doctrine\Bundle\FixturesBundle\Fixture;
use Doctrine\Common\Persistence\ObjectManager; use Doctrine\Common\Persistence\ObjectManager;
use App\Entity\User; 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) public function load(ObjectManager $manager)
{ {
@ -15,6 +20,6 @@ class UsersFixtures extends Fixture
public function adminUser() public function adminUser()
{ {
$admin = new User(); $admin = new User();
$admin->getSource(); $source = $admin->getSource();
} }
} }

View File

@ -0,0 +1,9 @@
<?php
namespace App\Entity\Source\Data;
use App\Entity\Source\AbstractSource;
abstract class AbstractDataSource extends AbstractSource implements DataSourceInterface
{
}

View File

@ -0,0 +1,9 @@
<?php
namespace App\Entity\Source\Data;
use App\Entity\Source\SourceInterface;
interface DataSourceInterface extends SourceInterface
{
}

View File

@ -1,6 +1,6 @@
<?php <?php
namespace App\Entity\Source; namespace App\Entity\Source\Data;
use App\Entity\Attribut\NameAttribut; use App\Entity\Attribut\NameAttribut;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
@ -11,7 +11,7 @@ use Symfony\Component\Validator\Constraints as Assert;
* @ORM\Table(name="source_name") * @ORM\Table(name="source_name")
* @ORM\Entity(repositoryClass="App\Repository\NameSourceRepository") * @ORM\Entity(repositoryClass="App\Repository\NameSourceRepository")
*/ */
final class NameSource extends AbstractSource implements NameSourceInterface final class NameSource extends AbstractDataSource implements NameSourceInterface
{ {
use NameAttribut; use NameAttribut;

View File

@ -0,0 +1,12 @@
<?php
namespace App\Entity\Source\Data;
use App\Entity\Attribut\NameAttributInterface;
/**
* @author kevinfrantz
*/
interface NameSourceInterface extends NameAttributInterface, DataSourceInterface
{
}

View File

@ -1,6 +1,6 @@
<?php <?php
namespace App\Entity\Source; namespace App\Entity\Source\Data;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert; use Symfony\Component\Validator\Constraints as Assert;
@ -13,7 +13,7 @@ use App\Entity\UserInterface;
* @ORM\Table(name="source_user") * @ORM\Table(name="source_user")
* @ORM\Entity(repositoryClass="App\Repository\UserSourceRepository") * @ORM\Entity(repositoryClass="App\Repository\UserSourceRepository")
*/ */
final class UserSource extends AbstractSource implements UserSourceInterface final class UserSource extends AbstractDataSource implements UserSourceInterface
{ {
use UserAttribut,NameSourceAttribut; use UserAttribut,NameSourceAttribut;

View File

@ -0,0 +1,14 @@
<?php
namespace App\Entity\Source\Data;
use App\Entity\Attribut\UserAttributInterface;
use App\Entity\Attribut\NameSourceAttributInterface;
use App\Entity\Source\SourceInterface;
/**
* @author kevinfrantz
*/
interface UserSourceInterface extends DataSourceInterface, UserAttributInterface, NameSourceAttributInterface
{
}

View File

@ -1,12 +0,0 @@
<?php
namespace App\Entity\Source;
use App\Entity\Attribut\NameAttributInterface;
/**
* @author kevinfrantz
*/
interface NameSourceInterface extends NameAttributInterface, SourceInterface
{
}

View File

@ -1,13 +0,0 @@
<?php
namespace App\Entity\Source;
use App\Entity\Attribut\UserAttributInterface;
use App\Entity\Attribut\NameSourceAttributInterface;
/**
* @author kevinfrantz
*/
interface UserSourceInterface extends SourceInterface, UserAttributInterface, NameSourceAttributInterface
{
}