Refactored Repositories

This commit is contained in:
Kevin Frantz
2019-01-16 20:40:15 +01:00
parent 662541cec2
commit 3ca5f3dc36
13 changed files with 70 additions and 38 deletions

View File

@@ -7,6 +7,6 @@ use Doctrine\ORM\EntityRepository;
/**
* @author kevinfrantz
*/
class LawRepository extends EntityRepository
abstract class AbstractRepository extends EntityRepository implements RepositoryInterface
{
}

View File

@@ -0,0 +1,12 @@
<?php
namespace App\Repository\Meta;
use App\Repository\AbstractRepository;
/**
* @author kevinfrantz
*/
final class LawRepository extends AbstractRepository
{
}

View File

@@ -0,0 +1,12 @@
<?php
namespace App\Repository\Meta;
use App\Repository\AbstractRepository;
/**
* @author kevinfrantz
*/
final class RightRepository extends AbstractRepository
{
}

View File

@@ -0,0 +1,13 @@
<?php
namespace App\Repository;
use Doctrine\Common\Persistence\ObjectRepository;
use Doctrine\Common\Collections\Selectable;
/**
* @author kevinfrantz
*/
interface RepositoryInterface extends ObjectRepository, Selectable
{
}

View File

@@ -1,12 +0,0 @@
<?php
namespace App\Repository;
use Doctrine\ORM\EntityRepository;
/**
* @author kevinfrantz
*/
class RightRepository extends EntityRepository
{
}

View File

@@ -0,0 +1,14 @@
<?php
namespace App\Repository\Source\Complex;
use App\Repository\AbstractRepository;
/**
* @author kevinfrantz
*
* @deprecated
*/
final class UserSourceRepository extends AbstractRepository
{
}

View File

@@ -2,14 +2,14 @@
namespace App\Repository\Source;
use Doctrine\ORM\EntityRepository;
use App\Entity\Source\SourceInterface;
use App\Domain\RequestManagement\RequestedSourceInterface;
use App\Repository\AbstractRepository;
/**
* @author kevinfrantz
*/
final class SourceRepository extends EntityRepository implements SourceRepositoryInterface
final class SourceRepository extends AbstractRepository implements SourceRepositoryInterface
{
public function findOneBySlug(string $slug): ?SourceInterface
{

View File

@@ -2,15 +2,14 @@
namespace App\Repository\Source;
use Doctrine\Common\Persistence\ObjectRepository;
use Doctrine\Common\Collections\Selectable;
use App\Entity\Source\SourceInterface;
use App\Domain\RequestManagement\RequestedSourceInterface;
use App\Repository\RepositoryInterface;
/**
* @author kevinfrantz
*/
interface SourceRepositoryInterface extends ObjectRepository, Selectable
interface SourceRepositoryInterface extends RepositoryInterface
{
/**
* Finds an Entity by slug.

View File

@@ -2,11 +2,9 @@
namespace App\Repository;
use Doctrine\ORM\EntityRepository;
/**
* @author kevinfrantz
*/
class UserRepository extends EntityRepository
final class UserRepository extends AbstractRepository
{
}

View File

@@ -1,14 +0,0 @@
<?php
namespace App\Repository;
use Doctrine\ORM\EntityRepository;
/**
* @author kevinfrantz
*
* @deprecated
*/
class UserSourceRepository extends EntityRepository
{
}