ZF\Apigility\Admin\Model\ModuleEntity::getVersions PHP Method

getVersions() public method

public getVersions ( ) : array
return array
    public function getVersions()
    {
        return $this->versions;
    }

Usage Example

 /**
  * Fetch all Doctrine services
  *
  * @param string $version
  * @return array
  */
 public function fetchAll($version = null)
 {
     $config = $this->configResource->fetch(true);
     if (!isset($config['zf-rest'])) {
         return [];
     }
     $services = [];
     $pattern = false;
     // Initialize pattern if a version was passed and it is valid
     if (null !== $version) {
         $version = (int) $version;
         if (!in_array($version, $this->moduleEntity->getVersions(), true)) {
             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-rest']) as $controllerService) {
         // Because a version is always supplied this check may not be necessary
         if (!$pattern) {
             $services[] = $this->fetch($controllerService);
             continue;
         }
         if (preg_match($pattern, $controllerService)) {
             $services[] = $this->fetch($controllerService);
             continue;
         }
     }
     return $services;
 }
All Usage Examples Of ZF\Apigility\Admin\Model\ModuleEntity::getVersions