Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // In module/Blog/src/Factory/ZendDbSqlRepositoryFactory.php
- namespace Blog\Factory;
- use Interop\Container\ContainerInterface;
- use Blog\Mapper\ZendDbSqlRepository;
- use Zend\Db\Adapter\AdapterInterface;
- use Zend\ServiceManager\Factory\FactoryInterface;
- class ZendDbSqlRepositoryFactory implements FactoryInterface
- {
- /**
- * @param ContainerInterface $container
- * @param string $requestedName
- * @param null|array $options
- * @return ZendDbSqlRepository
- */
- public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
- {
- return new ZendDbSqlRepository($container->get(AdapterInterface::class)); // changed from ZendDbSqlMapper in docs
- }
- }
Add Comment
Please, Sign In to add comment