コード例 #1
0
 public function __construct($objToReturn = null)
 {
     if (!empty($objToReturn)) {
         $property = GameRocket_Util::cleanClassName(get_class($objToReturn));
         $this->_returnObjectName = $property;
         $this->{$property} = $objToReturn;
     }
 }
コード例 #2
0
 public static function returnObjectOrThrowException($className, $resultObj)
 {
     $resultObjName = GameRocket_Util::cleanClassName($className);
     if ($resultObj->success) {
         return $resultObj->{$resultObjName};
     } else {
         throw new GameRocket_Exception_ValidationsFailed();
     }
 }
コード例 #3
0
ファイル: Http.php プロジェクト: ArcherCraftStore/Anasazi
 public static function delete($path, array $params = array())
 {
     $default = array('signature' => GameRocket_Crypto::sign('DELETE', GameRocket_Configuration::baseUrl() . $path, $params, GameRocket_Configuration::secretkey()));
     $response = self::_doRequest('DELETE', $path, array_merge($params, $default));
     if ($response['status'] === 200) {
         return true;
     } else {
         GameRocket_Util::throwStatusCodeException($response['status']);
     }
 }
コード例 #4
0
ファイル: Instance.php プロジェクト: ArcherCraftStore/Anasazi
 public function __toString()
 {
     $objOutput = GameRocket_Util::implodeAssociativeArray($this->_attributes);
     return get_class($this) . '[' . $objOutput . ']';
 }
コード例 #5
0
ファイル: Error.php プロジェクト: ArcherCraftStore/Anasazi
 public function __toString()
 {
     $output = GameRocket_Util::attributesToString($this->_attributes);
     return __CLASS__ . '[' . $output . ']';
 }
コード例 #6
0
ファイル: Player.php プロジェクト: ArcherCraftStore/Anasazi
 public function __toString()
 {
     return __CLASS__ . '[' . GameRocket_Util::attributesToString($this->_attributes) . ']';
 }
コード例 #7
0
ファイル: Util.php プロジェクト: ArcherCraftStore/Anasazi
 public static function attributesToString($attributes)
 {
     $printableAttribs = array();
     foreach ($attributes as $key => $value) {
         if (is_array($value)) {
             $pAttrib = GameRocket_Util::attributesToString($value);
         } else {
             if ($value instanceof DateTime) {
                 $pAttrib = $value->format(DateTime::RFC850);
             } else {
                 $pAttrib = $value;
             }
         }
         $printableAttribs[$key] = sprintf('%s', $pAttrib);
     }
     return GameRocket_Util::implodeAssociativeArray($printableAttribs);
 }