Mage_Api_Model_Server Class Reference

List of all members.

Public Member Functions

 init (Mage_Api_Controller_Action $controller, $adapter='default', $handler='default')
 run ()
 getAdapter ()

Protected Attributes

 $_adapter


Detailed Description

Definition at line 34 of file Server.php.


Member Function Documentation

getAdapter (  ) 

Retrieve web service adapter

Returns:
Mage_Api_Model_Server_Adaper_Interface

Definition at line 84 of file Server.php.

00085     {
00086         return $this->_adapter;
00087     }

init ( Mage_Api_Controller_Action controller,
adapter = 'default',
handler = 'default' 
)

Definition at line 43 of file Server.php.

00044     {
00045         $adapters = Mage::getSingleton('api/config')->getActiveAdapters();
00046         $handlers = Mage::getSingleton('api/config')->getHandlers();
00047         if (isset($adapters[$adapter])) {
00048             $adapterModel = Mage::getModel((string) $adapters[$adapter]->model);
00049             /* @var $adapterModel Mage_Api_Model_Server_Adapter_Interface */
00050             if (!($adapterModel instanceof Mage_Api_Model_Server_Adapter_Interface)) {
00051                 Mage::throwException(Mage::helper('api')->__('Invalid webservice adapter specified'));
00052             }
00053 
00054             $this->_adapter = $adapterModel;
00055             $this->_adapter->setController($controller);
00056 
00057             if (!isset($handlers->$handler)) {
00058                 Mage::throwException(Mage::helper('api')->__('Invalid webservice handler specified'));
00059             }
00060 
00061             $handlerClassName = Mage::getConfig()->getModelClassName((string) $handlers->$handler->model);
00062             $this->_adapter->setHandler($handlerClassName);
00063         } else {
00064             Mage::throwException(Mage::helper('api')->__('Invalid webservice adapter specified'));
00065         }
00066 
00067         return $this;
00068     }

run (  ) 

Run server

Definition at line 74 of file Server.php.

00075     {
00076         $this->getAdapter()->run();
00077     }


Member Data Documentation

$_adapter [protected]

Definition at line 41 of file Server.php.


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:23:33 2009 for Magento by  doxygen 1.5.8