* refactored with entity service, so the code can be tested
This commit is contained in:
@@ -2,16 +2,16 @@
|
||||
|
||||
namespace App\Action\Article;
|
||||
|
||||
use App\Action\AbstractFactory;
|
||||
use App\Action\Article\GetAction;
|
||||
use App\Service\Article\ArticleService;
|
||||
use Interop\Container\ContainerInterface;
|
||||
|
||||
class GetFactory extends AbstractFactory
|
||||
class GetFactory
|
||||
{
|
||||
|
||||
public function __invoke(ContainerInterface $container)
|
||||
{
|
||||
$em = $this->getEntityManager($container);
|
||||
return new GetAction($em);
|
||||
$entityService = $container->get(ArticleService::class);
|
||||
return new GetAction($entityService);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user