src/Server/Resource/DoctrineResourceFactory.php
/**
     * Can this factory create the requested service?
     *
     * @param ContainerInterface $container
     * @param string $requestedName
     * @return bool
     * @throws \Zend\ServiceManager\Exception\ServiceNotFoundException
     */
Can this factory create the requested service.
@param ContainerInterface $container
@param string $requestedName
@return bool
@throws \Zend\ServiceManager\Exception\ServiceNotFoundException
Can this factory create the requested service . @param ContainerInterface $container @param string $requestedName @return bool @throws \ Zend \ ServiceManager \ Exception \ ServiceNotFoundException
public function canCreate(ContainerInterface $container, $requestedName)
    {
        if (! $container->has('config')) {
            return false;
        }
        $config = $container->get('config');
        if (! isset($config['zf-apigility']['doctrine-connected'])
            || ! is_array($config['zf-apigility']['doctrine-connected'])
        ) {
            return false;
        }
        $config = $config['zf-apigility']['doctrine-connected'];
        if (! isset($config[$requestedName])
            || ! is_array($config[$requestedName])
            || ! $this->isValidConfig($config[$requestedName], $requestedName, $container)
        ) {
            return false;
        }
        return true;
    }
public function canCreate ( ContainerInterface $ container , $ requestedName ) { if ( ! $ container -> has ( 'config' ) ) { return false ; } $ config = $ container -> get ( 'config' ) ; if ( ! isset ( $ config [ 'zf-apigility' ] [ 'doctrine-connected' ] ) || ! is_array ( $ config [ 'zf-apigility' ] [ 'doctrine-connected' ] ) ) { return false ; } $ config = $ config [ 'zf-apigility' ] [ 'doctrine-connected' ] ; if ( ! isset ( $ config [ $ requestedName ] ) || ! is_array ( $ config [ $ requestedName ] ) || ! $ this -> isValidConfig ( $ config [ $ requestedName ] , $ requestedName , $ container ) ) { return false ; } return true ; }
Can this factory create the requested service?
Can this factory create the requested service?
//[$requestedName];