ZF\Apigility\DbConnectedResourceAbstractFactory::__invoke PHP Метод

__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
    public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
    {
        $config = $container->get('config');
        $config = $config['zf-apigility']['db-connected'][$requestedName];
        $table = $this->getTableGatewayFromConfig($config, $requestedName, $container);
        $identifier = $this->getIdentifierFromConfig($config);
        $collection = $this->getCollectionFromConfig($config, $requestedName);
        $resourceClass = $this->getResourceClassFromConfig($config, $requestedName);
        return new $resourceClass($table, $identifier, $collection);
    }