public function __construct($objToReturn = null) { if (!empty($objToReturn)) { $property = GameRocket_Util::cleanClassName(get_class($objToReturn)); $this->_returnObjectName = $property; $this->{$property} = $objToReturn; } }
public static function returnObjectOrThrowException($className, $resultObj) { $resultObjName = GameRocket_Util::cleanClassName($className); if ($resultObj->success) { return $resultObj->{$resultObjName}; } else { throw new GameRocket_Exception_ValidationsFailed(); } }