mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-01-09 22:17:26 +01:00
Refactored Repositories
This commit is contained in:
parent
662541cec2
commit
3ca5f3dc36
@ -12,7 +12,7 @@ use App\Entity\Attribut\GrantAttribut;
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
* @ORM\Table(name="meta_law")
|
||||
* @ORM\Entity(repositoryClass="App\Repository\LawRepository")
|
||||
* @ORM\Entity(repositoryClass="App\Repository\Meta\LawRepository")
|
||||
*/
|
||||
class Law extends AbstractMeta implements LawInterface
|
||||
{
|
||||
|
@ -23,7 +23,7 @@ use App\DBAL\Types\Meta\Right\CRUDType;
|
||||
*
|
||||
* @author kevinfrantz
|
||||
* @ORM\Table(name="meta_right")
|
||||
* @ORM\Entity(repositoryClass="App\Repository\RightRepository")
|
||||
* @ORM\Entity(repositoryClass="App\Repository\Meta\RightRepository")
|
||||
*/
|
||||
class Right extends AbstractMeta implements RightInterface
|
||||
{
|
||||
@ -99,6 +99,11 @@ class Right extends AbstractMeta implements RightInterface
|
||||
$this->priority = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @see \App\Entity\Attribut\TypeAttributInterface::setType()
|
||||
*/
|
||||
public function setType(string $type): void
|
||||
{
|
||||
if (!array_key_exists($type, CRUDType::getChoices())) {
|
||||
@ -107,6 +112,11 @@ class Right extends AbstractMeta implements RightInterface
|
||||
$this->type = $type;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @see \App\Entity\Attribut\LayerAttributInterface::setLayer()
|
||||
*/
|
||||
public function setLayer(string $layer): void
|
||||
{
|
||||
if (!array_key_exists($layer, LayerType::getChoices())) {
|
||||
|
@ -9,7 +9,7 @@ use App\Entity\Attribut\PersonIdentitySourceAttribut;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
* @ORM\Entity(repositoryClass="App\Repository\UserSourceRepository")
|
||||
* @ORM\Entity(repositoryClass="App\Repository\Source\Complex\UserSourceRepository")
|
||||
*/
|
||||
class UserSource extends AbstractComplexSource implements UserSourceInterface
|
||||
{
|
||||
|
@ -7,6 +7,6 @@ use Doctrine\ORM\EntityRepository;
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
class LawRepository extends EntityRepository
|
||||
abstract class AbstractRepository extends EntityRepository implements RepositoryInterface
|
||||
{
|
||||
}
|
12
application/symfony/src/Repository/Meta/LawRepository.php
Normal file
12
application/symfony/src/Repository/Meta/LawRepository.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repository\Meta;
|
||||
|
||||
use App\Repository\AbstractRepository;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
final class LawRepository extends AbstractRepository
|
||||
{
|
||||
}
|
12
application/symfony/src/Repository/Meta/RightRepository.php
Normal file
12
application/symfony/src/Repository/Meta/RightRepository.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repository\Meta;
|
||||
|
||||
use App\Repository\AbstractRepository;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
final class RightRepository extends AbstractRepository
|
||||
{
|
||||
}
|
13
application/symfony/src/Repository/RepositoryInterface.php
Normal file
13
application/symfony/src/Repository/RepositoryInterface.php
Normal 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
|
||||
{
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use Doctrine\ORM\EntityRepository;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
class RightRepository extends EntityRepository
|
||||
{
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repository\Source\Complex;
|
||||
|
||||
use App\Repository\AbstractRepository;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
final class UserSourceRepository extends AbstractRepository
|
||||
{
|
||||
}
|
@ -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
|
||||
{
|
||||
|
@ -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.
|
||||
|
@ -2,11 +2,9 @@
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use Doctrine\ORM\EntityRepository;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
class UserRepository extends EntityRepository
|
||||
final class UserRepository extends AbstractRepository
|
||||
{
|
||||
}
|
||||
|
@ -1,14 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use Doctrine\ORM\EntityRepository;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
class UserSourceRepository extends EntityRepository
|
||||
{
|
||||
}
|
Loading…
Reference in New Issue
Block a user