mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-09-13 13:57:10 +02:00
Refactored draft for Request Management
This commit is contained in:
@@ -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());
|
||||
|
Reference in New Issue
Block a user