/** * @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; }
public static function SetMethod($sMethod) { self::$sMethod = $sMethod; }
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)); }