Exemplo n.º 1
0
 /**
  * @param $service
  * @param $operationName
  * @param $baseURL
  * @return OperationDefinition
  * @throws \ArtaxServiceBuilder\APIBuilderException
  */
 function createOperationDescription($service, $operationName, $baseURL)
 {
     if (isset($service["operations"][$operationName]) == false) {
         throw new APIBuilderException("Service does not have operation named `{$operationName}`.");
     }
     $operationDescription = $service["operations"][$operationName];
     if (isset($operationDescription['extends'])) {
         $operation = $this->createOperationDescription($service, $operationDescription['extends'], $baseURL);
     } else {
         $operation = new OperationDefinition();
     }
     $operation->setName($operationName);
     $operation->setURL($baseURL);
     //Do this first, as it can be overwritten
     $operation->setFromServiceDescription($operationDescription, $baseURL, $this);
     return $operation;
 }