PHP Class ZF\Apigility\TableGatewayAbstractFactory

Inheritance: implements Zend\ServiceManager\AbstractFactoryInterface
Mostrar archivo Open project: zfcampus/zf-apigility

Public Methods

Method Description
__invoke ( Interop\Container\ContainerInterface $container, string $requestedName, array $options = null ) : Zend\Db\TableGateway\TableGateway Create and return the requested table gateway instance.
canCreate ( Interop\Container\ContainerInterface $container, string $requestedName ) : boolean Can this factory create the requested table gateway?
canCreateServiceWithName ( Zend\ServiceManager\ServiceLocatorInterface $container, string $name, string $requestedName ) : boolean Can this factory create the requested table gateway? (v2)
createServiceWithName ( Zend\ServiceManager\ServiceLocatorInterface $container, string $name, string $requestedName ) : Zend\Db\TableGateway\TableGateway Create and return the requested table gateway instance (v2).

Protected Methods

Method Description
getAdapterFromConfig ( array $config, Interop\Container\ContainerInterface $container ) : Zend\Db\Adapter\AdapterInterface Retrieve a zend-db adapter via provided configuration.
getEntityFromConfig ( array $config, string $requestedName ) : string Retrieve the configured entity.
getHydratorFromConfig ( array $config, Interop\Container\ContainerInterface $container ) : Zend\Hydrator\HydratorInterface Retrieve the configured hydrator.
isValidConfig ( array $config, Interop\Container\ContainerInterface $container ) : boolean Is the configuration valid?

Method Details

__invoke() public method

Create and return the requested table gateway instance.
public __invoke ( Interop\Container\ContainerInterface $container, string $requestedName, array $options = null ) : Zend\Db\TableGateway\TableGateway
$container Interop\Container\ContainerInterface
$requestedName string
$options array
return Zend\Db\TableGateway\TableGateway

canCreate() public method

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

canCreateServiceWithName() public method

Provided for backwards compatibility; 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 ) : Zend\Db\TableGateway\TableGateway
$container Zend\ServiceManager\ServiceLocatorInterface
$name string
$requestedName string
return Zend\Db\TableGateway\TableGateway

getAdapterFromConfig() protected method

If the configuration defines an adapter_name and a matching service is discovered, that will be returned. If the Adapter service is present, that will be returned (zend-mvc v2). Otherwise, the AdapterInterface service is returned.
protected getAdapterFromConfig ( array $config, Interop\Container\ContainerInterface $container ) : Zend\Db\Adapter\AdapterInterface
$config array
$container Interop\Container\ContainerInterface
return Zend\Db\Adapter\AdapterInterface

getEntityFromConfig() protected method

If configuration defines an entity_class, and the class exists, that value is returned; if no configuration is provided, stdClass is returned.
protected getEntityFromConfig ( array $config, string $requestedName ) : string
$config array
$requestedName string
return string Class name of entity

getHydratorFromConfig() protected method

If configuration defines a hydrator_name, that service will be retrieved from the HydratorManager; otherwise ArraySerializable will be retrieved.
protected getHydratorFromConfig ( array $config, Interop\Container\ContainerInterface $container ) : Zend\Hydrator\HydratorInterface
$config array
$container Interop\Container\ContainerInterface
return Zend\Hydrator\HydratorInterface

isValidConfig() protected method

Is the configuration valid?
protected isValidConfig ( array $config, Interop\Container\ContainerInterface $container ) : boolean
$config array
$container Interop\Container\ContainerInterface
return boolean