Implemented RequestedSource

This commit is contained in:
Kevin Frantz 2019-01-13 15:53:23 +01:00
parent 054a136f14
commit 62257b1771
3 changed files with 27 additions and 2 deletions

View File

@ -0,0 +1,12 @@
<?php
namespace App\Domain\SourceManagement;
use App\Entity\Source\AbstractSource;
/**
* @author kevinfrantz
*/
final class RequestedSource extends AbstractSource implements RequestedSourceInterface
{
}

View File

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

View File

@ -4,6 +4,7 @@ namespace App\Repository\Source;
use Doctrine\ORM\EntityRepository;
use App\Entity\Source\SourceInterface;
use App\Domain\SourceManagement\RequestedSourceInterface;
final class SourceRepository extends EntityRepository
{
@ -22,11 +23,11 @@ final class SourceRepository extends EntityRepository
/**
* Loads a source by id or if not defined, by slug.
*
* @param SourceInterface $requestedSource
* @param RequestedSourceInterface $requestedSource
*
* @return SourceInterface|null
*/
public function findOneByIdOrSlug(SourceInterface $requestedSource): ?SourceInterface
public function findOneByIdOrSlug(RequestedSourceInterface $requestedSource): ?SourceInterface
{
try {
return $this->find($requestedSource->getId());