PHP Класс ZF\Apigility\DbConnectedResourceAbstractFactory

Наследование: implements Zend\ServiceManager\AbstractFactoryInterface
Показать файл Открыть проект

Открытые методы

Метод Описание
__invoke ( Interop\Container\ContainerInterface $container, string $requestedName, array $options = null ) : ZF\Rest\Resource Create and return the database-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 ) : ZF\Rest\Resource Create and return the database-connected resource (v2).

Защищенные методы

Метод Описание
getCollectionFromConfig ( array $config, string $requestedName ) : string Retrieve the collection class based on the provided configuration.
getIdentifierFromConfig ( array $config ) : string Retrieve the table identifier field from the provided configuration.
getResourceClassFromConfig ( array $config, string $requestedName ) : string Retrieve the resource class based on the provided configuration.
getTableGatewayFromConfig ( array $config, string $requestedName, Interop\Container\ContainerInterface $container ) : Zend\Db\TableGateway\TableGatewayInterface Retrieve a table gateway instance based on provided configuration.
isValidConfig ( array $config, string $requestedName, Interop\Container\ContainerInterface $container ) : boolean Tests if the configuration is valid

Описание методов

__invoke() публичный метод

Create and return the database-connected resource.
public __invoke ( Interop\Container\ContainerInterface $container, string $requestedName, array $options = null ) : ZF\Rest\Resource
$container Interop\Container\ContainerInterface
$requestedName string
$options array
Результат ZF\Rest\Resource

canCreate() публичный метод

Can this factory create the requested service?
public canCreate ( Interop\Container\ContainerInterface $container, string $requestedName ) : boolean
$container Interop\Container\ContainerInterface
$requestedName string
Результат boolean

canCreateServiceWithName() публичный метод

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
Результат boolean

createServiceWithName() публичный метод

Provided for backwards compatibility; proxies to __invoke().
public createServiceWithName ( Zend\ServiceManager\ServiceLocatorInterface $container, string $name, string $requestedName ) : ZF\Rest\Resource
$container Zend\ServiceManager\ServiceLocatorInterface
$name string
$requestedName string
Результат ZF\Rest\Resource

getCollectionFromConfig() защищенный метод

Defaults to Zend\Paginator\Paginator.
protected getCollectionFromConfig ( array $config, string $requestedName ) : string
$config array
$requestedName string
Результат string

getIdentifierFromConfig() защищенный метод

Defaults to 'id' if none is found.
protected getIdentifierFromConfig ( array $config ) : string
$config array
Результат string

getResourceClassFromConfig() защищенный метод

Defaults to ZF\Apigility\DbConnectedResource.
protected getResourceClassFromConfig ( array $config, string $requestedName ) : string
$config array
$requestedName string
Результат string

getTableGatewayFromConfig() защищенный метод

Retrieve a table gateway instance based on provided configuration.
protected getTableGatewayFromConfig ( array $config, string $requestedName, Interop\Container\ContainerInterface $container ) : Zend\Db\TableGateway\TableGatewayInterface
$config array
$requestedName string
$container Interop\Container\ContainerInterface
Результат Zend\Db\TableGateway\TableGatewayInterface

isValidConfig() защищенный метод

If the configuration has a "table_service" key, and that service exists, then the configuration is valid. Otherwise, it checks if the service $requestedName\Table exists.
protected isValidConfig ( array $config, string $requestedName, Interop\Container\ContainerInterface $container ) : boolean
$config array
$requestedName string
$container Interop\Container\ContainerInterface
Результат boolean