src/Admin/Model/DoctrineRpcServiceModel.php
/**
     * Fetch all services
     *
     * @param string $version
     * @return DoctrineRpcServiceEntity[]
     */
Fetch all services
@param string $version
@return DoctrineRpcServiceEntity[]
Fetch all services @param string $version @return DoctrineRpcServiceEntity []
public function fetchAll($version = null)
    {
        $config = $this->configResource->fetch(true);
        if (! isset($config['zf-rpc-doctrine-controller'])) {
            return [];
        }
        $services = [];
        $pattern  = false;
        if (null !== $version) {
            if (! in_array($version, $this->moduleEntity->getVersions())) {
                throw new Exception\RuntimeException(
                    sprintf('Invalid version "%s" provided', $version),
                    400
                );
            }
            $namespaceSep = preg_quote('\\');
            $pattern = sprintf(
                '#%s%sV%s#',
                $this->module,
                $namespaceSep,
                $version
            );
        }
        foreach (array_keys($config['zf-rpc-doctrine-controller']) as $controllerService) {
            if (! $pattern) {
                $services[] = $this->fetch($controllerService);
                continue;
            }
            if (preg_match($pattern, $controllerService)) {
                $services[] = $this->fetch($controllerService);
                continue;
            }
        }
        return $services;
    }
public function fetchAll ( $ version = null ) { $ config = $ this -> configResource -> fetch ( true ) ; if ( ! isset ( $ config [ 'zf-rpc-doctrine-controller' ] ) ) { return [ ] ; } $ services = [ ] ; $ pattern = false ; if ( null !== $ version ) { if ( ! in_array ( $ version , $ this -> moduleEntity -> getVersions ( ) ) ) { throw new Exception \ RuntimeException ( sprintf ( 'Invalid version "%s" provided' , $ version ) , 400 ) ; } $ namespaceSep = preg_quote ( '\\' ) ; $ pattern = sprintf ( '#%s%sV%s#' , $ this -> module , $ namespaceSep , $ version ) ; } foreach ( array_keys ( $ config [ 'zf-rpc-doctrine-controller' ] ) as $ controllerService ) { if ( ! $ pattern ) { $ services [ ] = $ this -> fetch ( $ controllerService ) ; continue ; } if ( preg_match ( $ pattern , $ controllerService ) ) { $ services [ ] = $ this -> fetch ( $ controllerService ) ; continue ; } } return $ services ; }
Fetch all services
 @param string $version
 @return DoctrineRpcServiceEntity[]
Fetch all services @param string $version @return DoctrineRpcServiceEntity []
// Initialize pattern if a version was passed and it's valid // Ignored from code coverage because Apigility sets the version // and it's no longer handled here: FIXME: verify this