Exemplo n.º 1
0
 /**
  * Process array of types.
  *
  * @param string $type
  * @param array $callInfo
  */
 protected function _processArrayParameter($type, $callInfo = array())
 {
     $arrayItemType = $this->_helper->getArrayItemType($type);
     $arrayTypeName = $this->_helper->translateArrayTypeName($type);
     if (!$this->_helper->isTypeSimple($arrayItemType)) {
         $this->addComplexType($arrayItemType, $callInfo);
     }
     $arrayTypeParameters = array(self::ARRAY_ITEM_KEY_NAME => array('type' => $arrayItemType, 'required' => false, 'isArray' => true, 'documentation' => sprintf('An item of %s.', $arrayTypeName)));
     $arrayTypeData = array('documentation' => sprintf('An array of %s items.', $arrayItemType), 'parameters' => $arrayTypeParameters);
     $this->_config->setTypeData($arrayTypeName, $arrayTypeData);
     $this->addComplexType($arrayTypeName, $callInfo);
 }
Exemplo n.º 2
0
 /**
  * Process call info data from interface.
  *
  * @param array $interface
  * @param string $resourceName
  * @param string $methodName
  */
 protected function _processInterfaceCallInfo($interface, $resourceName, $methodName)
 {
     foreach ($interface as $direction => $interfaceData) {
         $direction = $direction == 'in' ? 'requiredInput' : 'returned';
         foreach ($interfaceData['parameters'] as $parameterData) {
             $parameterType = $parameterData['type'];
             if (!$this->_helper->isTypeSimple($parameterType)) {
                 $operation = $this->getOperationName($resourceName, $methodName);
                 if ($parameterData['required']) {
                     $condition = $direction == 'requiredInput' ? 'yes' : 'always';
                 } else {
                     $condition = $direction == 'requiredInput' ? 'no' : 'conditionally';
                 }
                 $callInfo = array();
                 $callInfo[$direction][$condition]['calls'][] = $operation;
                 $this->_apiConfig->setTypeData($parameterType, array('callInfo' => $callInfo));
             }
         }
     }
 }