PHP Class ZF\Apigility\Doctrine\Server\Resource\DoctrineResourceFactory

Inheritance: implements Zend\ServiceManager\AbstractFactoryInterface
Exibir arquivo Open project: zfcampus/zf-apigility-doctrine

Public Methods

Method Description
__invoke ( Interop\Container\ContainerInterface $container, string $requestedName, array $options = null ) : DoctrineResource Create and return the doctrine-connected resource.
canCreate ( Interop\Container\ContainerInterface $container, string $requestedName ) : boolean Can this factory create the requested service?
canCreateServiceWithName ( Zend\ServiceManager\ServiceLocatorInterface $container, string $name, string $requestedName ) : boolean Can this factory create the requested service? (v2)
createServiceWithName ( Zend\ServiceManager\ServiceLocatorInterface $container, string $name, string $requestedName ) : DoctrineResource Create and return the doctrine-connected resource (v2).

Protected Methods

Method Description
getResourceClassFromConfig ( array $config, string $requestedName ) : string Retrieve the resource class based on the provided configuration.
isValidConfig ( array $config, string $requestedName, Interop\Container\ContainerInterface $container ) : boolean Tests if the configuration is valid
loadConfiguredListeners ( Interop\Container\ContainerInterface $container, array $config ) : array
loadHydrator ( Interop\Container\ContainerInterface $container, array $doctrineConnectedConfig, array $doctrineHydratorConfig ) : Zend\Hydrator\HydratorInterface
loadQueryCreateFilter ( Interop\Container\ContainerInterface $container, array $config, Doctrine\Common\Persistence\ObjectManager $objectManager ) : ZF\Apigility\Doctrine\Server\Query\CreateFilter\QueryCreateFilterInterface
loadQueryProviders ( Interop\Container\ContainerInterface $serviceLocator, array $config, Doctrine\Common\Persistence\ObjectManager $objectManager ) : array
normalizeClassname ( string $className ) : string

Method Details

__invoke() public method

Create and return the doctrine-connected resource.
public __invoke ( Interop\Container\ContainerInterface $container, string $requestedName, array $options = null ) : DoctrineResource
$container Interop\Container\ContainerInterface
$requestedName string
$options array
return DoctrineResource

canCreate() public method

Can this factory create the requested service?
public canCreate ( Interop\Container\ContainerInterface $container, string $requestedName ) : boolean
$container Interop\Container\ContainerInterface
$requestedName string
return boolean

canCreateServiceWithName() public method

Provided for backwards compatiblity; proxies to canCreate().
public canCreateServiceWithName ( Zend\ServiceManager\ServiceLocatorInterface $container, string $name, string $requestedName ) : boolean
$container Zend\ServiceManager\ServiceLocatorInterface
$name string
$requestedName string
return boolean

createServiceWithName() public method

Provided for backwards compatibility; proxies to __invoke().
public createServiceWithName ( Zend\ServiceManager\ServiceLocatorInterface $container, string $name, string $requestedName ) : DoctrineResource
$container Zend\ServiceManager\ServiceLocatorInterface
$name string
$requestedName string
return DoctrineResource

getResourceClassFromConfig() protected method

Defaults to ZF\Apigility\Doctrine\Server\Resource\DoctrineResource.
protected getResourceClassFromConfig ( array $config, string $requestedName ) : string
$config array
$requestedName string
return string

isValidConfig() protected method

If the configuration has a "object_manager" key, and that service exists, then the configuration is valid.
protected isValidConfig ( array $config, string $requestedName, Interop\Container\ContainerInterface $container ) : boolean
$config array
$requestedName string
$container Interop\Container\ContainerInterface
return boolean

loadConfiguredListeners() protected method

protected loadConfiguredListeners ( Interop\Container\ContainerInterface $container, array $config ) : array
$container Interop\Container\ContainerInterface
$config array
return array

loadHydrator() protected method

protected loadHydrator ( Interop\Container\ContainerInterface $container, array $doctrineConnectedConfig, array $doctrineHydratorConfig ) : Zend\Hydrator\HydratorInterface
$container Interop\Container\ContainerInterface
$doctrineConnectedConfig array
$doctrineHydratorConfig array
return Zend\Hydrator\HydratorInterface

loadQueryCreateFilter() protected method

protected loadQueryCreateFilter ( Interop\Container\ContainerInterface $container, array $config, Doctrine\Common\Persistence\ObjectManager $objectManager ) : ZF\Apigility\Doctrine\Server\Query\CreateFilter\QueryCreateFilterInterface
$container Interop\Container\ContainerInterface
$config array
$objectManager Doctrine\Common\Persistence\ObjectManager
return ZF\Apigility\Doctrine\Server\Query\CreateFilter\QueryCreateFilterInterface

loadQueryProviders() protected method

protected loadQueryProviders ( Interop\Container\ContainerInterface $serviceLocator, array $config, Doctrine\Common\Persistence\ObjectManager $objectManager ) : array
$serviceLocator Interop\Container\ContainerInterface
$config array
$objectManager Doctrine\Common\Persistence\ObjectManager
return array

normalizeClassname() protected method

protected normalizeClassname ( string $className ) : string
$className string
return string