Пример #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();
     }
 }