Ejemplo n.º 1
0
 /**
  * Select out the simple result string
  * 
  * This is primarily for use by legacy methods within
  * Cpanel_Service_Adapter_Liveapi
  * 
  * @param Cpanel_Query_Object $rObj Response object
  * 
  * @return mixed Value stored in the data->result node of server response
  */
 public function getLegacyString($rObj)
 {
     if ($rObj->validResponse()) {
         return $rObj->cpanelresult->data->result;
     } else {
         return null;
     }
 }
Ejemplo n.º 2
0
 /**
  * Handle special modes where output is expected to be something other than
  * the default Cpanel_Query_Object
  * 
  * @param Cpanel_Query_Object $rObj Response object
  * 
  * @return mixed
  * @throws Exception If invalid input
  */
 private function _returnOutputMode($rObj)
 {
     if (!$rObj instanceof Cpanel_Query_Object) {
         throw new Exception('Invalid response object');
     }
     $r = $rObj;
     if ($rObj->validResponse()) {
         if ($this->mode & self::LEGACY_STRING_MODE) {
             $r = $rObj->getResponseParser()->getLegacyString($rObj);
         }
     }
     return $r;
 }