/**
  * Create documentation details for a given API module and version
  *
  * @param string $apiName
  * @param int|string $apiVersion
  * @return Api
  */
 public function createApi($apiName, $apiVersion = 1)
 {
     $api = new Api();
     $api->setVersion($apiVersion);
     $api->setName($apiName);
     $serviceConfigs = array();
     if ($this->config['zf-rest']) {
         $serviceConfigs = array_merge($serviceConfigs, $this->config['zf-rest']);
     }
     if ($this->config['zf-rpc']) {
         $serviceConfigs = array_merge($serviceConfigs, $this->config['zf-rpc']);
     }
     foreach ($serviceConfigs as $serviceName => $serviceConfig) {
         if (strpos($serviceName, $apiName . '\\') === 0 && strpos($serviceName, '\\V' . $api->getVersion() . '\\') && isset($serviceConfig['service_name'])) {
             $service = $this->createService($api, $serviceConfig['service_name']);
             if ($service) {
                 $api->addService($service);
             }
         }
     }
     return $api;
 }
 private function createResourceGroups()
 {
     foreach ($this->api->getServices() as $service) {
         $this->resourceGroups[] = new ResourceGroup($service);
     }
 }