Ejemplo n.º 1
0
 /**
  * @param string $sMethod
  * @param mixed $mResult = false
  *
  * @return array
  */
 public function DefaultResponse($sMethod, $mResult = false)
 {
     $aResult = array('AuthenticatedUserId' => \CApi::getAuthenticatedUserId(), '@Time' => microtime(true) - AURORA_APP_START);
     if (is_array($mResult)) {
         foreach ($mResult as $aValue) {
             $aResponseResult = \CApiResponseManager::GetResponseObject($aValue, array('Module' => $aValue['Module'], 'Method' => $aValue['Method']));
             if ($aValue['Module'] === $this->GetName() && $aValue['Method'] === $sMethod) {
                 $aResult = array_merge($aResult, $aResponseResult);
             } else {
                 $aResult['Stack'][] = $aResponseResult;
             }
         }
     }
     return $aResult;
 }
Ejemplo n.º 2
0
 public static function SetMethod($sMethod)
 {
     self::$sMethod = $sMethod;
 }
Ejemplo n.º 3
0
 public function toResponseArray($aParameters = array())
 {
     $aNames = explode('\\', get_class($this));
     $sObjectName = end($aNames);
     return array('@Object' => 'Collection/' . \CApiResponseManager::GetObjectName($sObjectName), '@Count' => $this->Count(), '@Collection' => \CApiResponseManager::GetResponseObject($this->CloneAsArray(), $aParameters));
 }