Refactored draft for Request Management

This commit is contained in:
Kevin Frantz
2019-01-20 12:54:56 +01:00
parent 7e9916b27b
commit 86198ff2df
40 changed files with 490 additions and 176 deletions

View File

@@ -3,7 +3,7 @@
namespace App\Repository\Source;
use App\Entity\Source\SourceInterface;
use App\Domain\RequestManagement\RequestedSourceInterface;
use App\Domain\RequestManagement\Entity\RequestedEntityInterface;
use App\Repository\AbstractRepository;
/**
@@ -11,6 +11,11 @@ use App\Repository\AbstractRepository;
*/
final class SourceRepository extends AbstractRepository implements SourceRepositoryInterface
{
/**
* {@inheritdoc}
*
* @see \App\Repository\Source\SourceRepositoryInterface::findOneBySlug()
*/
public function findOneBySlug(string $slug): ?SourceInterface
{
return $this->findOneBy([
@@ -18,7 +23,12 @@ final class SourceRepository extends AbstractRepository implements SourceReposit
]);
}
public function findOneByIdOrSlug(RequestedSourceInterface $requestedSource): ?SourceInterface
/**
* {@inheritdoc}
*
* @see \App\Repository\Source\SourceRepositoryInterface::findOneByIdOrSlug()
*/
public function findOneByIdOrSlug(RequestedEntityInterface $requestedSource): ?SourceInterface
{
if ($requestedSource->hasId()) {
return $this->find($requestedSource->getId());