public function setClass($class, $namespace = '', $argv = null)
    {
        if (is_string($class) && !class_exists($class)){
            require_once 'Zend/Amf/Server/Exception.php';
            throw new Zend_Amf_Server_Exception('Invalid method or class');
        } elseif (!is_string($class) && !is_object($class)) {
            require_once 'Zend/Amf/Server/Exception.php';
            throw new Zend_Amf_Server_Exception('Invalid method or class; must be a classname or object');
        }

        $argv = null;
        if (2 < func_num_args()) {
            $argv = array_slice(func_get_args(), 2);
        }

        // Use the class name as the name space by default.

        if ($namespace == '') {
            $namespace = is_object($class) ? get_class($class) : $class;
        }

        $this->_classAllowed[is_object($class) ? get_class($class) : $class] = true;

        $this->_methods[] = Zend_Server_Reflection::reflectClass($class, $argv, $namespace);
        $this->_buildDispatchTable();

        return $this;
    }
public function setClass($class, $namespace = '', $argv = null)
    {
        if (is_string($class) && !class_exists($class)){
            require_once 'Zend/Amf/Server/Exception.php';
            throw new Zend_Amf_Server_Exception('Invalid method or class');
        } elseif (!is_string($class) && !is_object($class)) {
            require_once 'Zend/Amf/Server/Exception.php';
            throw new Zend_Amf_Server_Exception('Invalid method or class; must be a classname or object');
        }

        $argv = null;
        if (2 < func_num_args()) {
            $argv = array_slice(func_get_args(), 2);
        }

        // Use the class name as the name space by default.

        if ($namespace == '') {
            $namespace = is_object($class) ? get_class($class) : $class;
        }

        $this->_classAllowed[is_object($class) ? get_class($class) : $class] = true;

        $this->_methods[] = Zend_Server_Reflection::reflectClass($class, $argv, $namespace);
        $this->_buildDispatchTable();

        return $this;
    }
public function setClass ( $ class , $ namespace = '' , $ argv = null ) { if ( is_string ( $ class ) && ! class_exists ( $ class ) ) { require_once 'Zend/Amf/Server/Exception.php' ; throw new Zend_Amf_Server_Exception ( 'Invalid method or class' ) ; } elseif ( ! is_string ( $ class ) && ! is_object ( $ class ) ) { require_once 'Zend/Amf/Server/Exception.php' ; throw new Zend_Amf_Server_Exception ( 'Invalid method or class; must be a classname or object' ) ; } $ argv = null ; if ( 2 < func_num_args ( ) ) { $ argv = array_slice ( func_get_args ( ) , 2 ) ; } // Use the class name as the name space by default. if ( $ namespace == '' ) { $ namespace = is_object ( $ class ) ? get_class ( $ class ) : $ class ; } $ this -> _classAllowed [ is_object ( $ class ) ? get_class ( $ class ) : $ class ] = true ; $ this -> _methods [ ] = Zend_Server_Reflection :: reflectClass ( $ class , $ argv , $ namespace ) ; $ this -> _buildDispatchTable ( ) ; return $ this ; }
Attach a class or object to the server

Class may be either a class name or an instantiated object. Reflection
is done on the class or object to determine the available public
methods, and each is attached to the server as and available method. If
a $namespace has been provided, that namespace is used to prefix
AMF service call.

@param  string|object $class
@param  string $namespace Optional
@param  mixed $arg Optional arguments to pass to a method
@return Zend_Amf_Server
@throws Zend_Amf_Server_Exception on invalid input
Attach a class or object to the server