Moodle  2.2.1
http://www.collinsharper.com
C:/xampp/htdocs/moodle/lib/zend/Zend/Service/DeveloperGarden/BaseUserService.php
Go to the documentation of this file.
00001 <?php
00026 require_once 'Zend/Service/DeveloperGarden/Client/ClientAbstract.php';
00027 
00031 require_once 'Zend/Service/DeveloperGarden/Response/BaseUserService/GetQuotaInformationResponse.php';
00032 
00036 require_once 'Zend/Service/DeveloperGarden/Response/BaseUserService/ChangeQuotaPoolResponse.php';
00037 
00041 require_once 'Zend/Service/DeveloperGarden/Response/BaseUserService/GetAccountBalanceResponse.php';
00042 
00046 require_once 'Zend/Service/DeveloperGarden/BaseUserService/AccountBalance.php';
00047 
00051 require_once 'Zend/Service/DeveloperGarden/Request/BaseUserService/GetQuotaInformation.php';
00052 
00056 require_once 'Zend/Service/DeveloperGarden/Request/BaseUserService/ChangeQuotaPool.php';
00057 
00061 require_once 'Zend/Service/DeveloperGarden/Request/BaseUserService/GetAccountBalance.php';
00062 
00071 class Zend_Service_DeveloperGarden_BaseUserService extends Zend_Service_DeveloperGarden_Client_ClientAbstract
00072 {
00078     protected $_wsdlFile = 'https://gateway.developer.telekom.com/p3gw-mod-odg-admin/services/ODGBaseUserService?wsdl';
00079 
00085     protected $_wsdlFileLocal = 'Wsdl/ODGBaseUserService.wsdl';
00086 
00093     protected $_classMap = array(
00094         'getQuotaInformationResponse' =>
00095             'Zend_Service_DeveloperGarden_Response_BaseUserService_GetQuotaInformationResponse',
00096         'changeQuotaPoolResponse' =>
00097             'Zend_Service_DeveloperGarden_Response_BaseUserService_ChangeQuotaPoolResponse',
00098         'getAccountBalanceResponse' =>
00099             'Zend_Service_DeveloperGarden_Response_BaseUserService_GetAccountBalanceResponse',
00100         'AccountBalance' =>
00101             'Zend_Service_DeveloperGarden_BaseUserService_AccountBalance',
00102     );
00103 
00109     protected $_moduleIds = array(
00110         'SmsProduction'            => 'SmsProduction',
00111         'SmsSandbox'               => 'SmsSandbox',
00112         'VoiceCallProduction'      => 'VoiceButlerProduction',
00113         'VoiceCallSandbox'         => 'VoiceButlerSandbox',
00114         'ConferenceCallProduction' => 'CCSProduction',
00115         'ConferenceCallSandbox'    => 'CCSSandbox',
00116         'LocalSearchProduction'    => 'localsearchProduction',
00117         'LocalSearchSandbox'       => 'localsearchSandbox',
00118         'IPLocationProduction'     => 'IPLocationProduction',
00119         'IPLocationSandbox'        => 'IPLocationSandbox'
00120     );
00121 
00127     public function getModuleIds()
00128     {
00129         return $this->_moduleIds;
00130     }
00131 
00139     protected function _checkModuleId($moduleId)
00140     {
00141         if (!in_array($moduleId, $this->_moduleIds)) {
00142             require_once 'Zend/Service/DeveloperGarden/Client/Exception.php';
00143             throw new Zend_Service_DeveloperGarden_Client_Exception('moduleId not valid');
00144         }
00145     }
00146 
00154     protected function _buildModuleString($module, $environment)
00155     {
00156         $moduleString = $module;
00157         switch($environment) {
00158             case self::ENV_PRODUCTION :
00159                 $moduleString .= 'Production';
00160                 break;
00161             case self::ENV_SANDBOX :
00162                 $moduleString .= 'Sandbox';
00163                 break;
00164             default:
00165                 require_once 'Zend/Service/DeveloperGarden/Client/Exception.php';
00166                 throw new Zend_Service_DeveloperGarden_Client_Exception(
00167                     'Not a valid environment supplied.'
00168                 );
00169         }
00170 
00171         if (!in_array($moduleString, $this->_moduleIds)) {
00172             require_once 'Zend/Service/DeveloperGarden/Client/Exception.php';
00173             throw new Zend_Service_DeveloperGarden_Client_Exception(
00174                 'Not a valid module name supplied.'
00175             );
00176         }
00177 
00178         return $moduleString;
00179     }
00180 
00187     protected function _getRequestModule($moduleId)
00188     {
00189         return new Zend_Service_DeveloperGarden_Request_BaseUserService_GetQuotaInformation(
00190             $moduleId
00191         );
00192     }
00193 
00201     protected function _getChangeRequestModule($moduleId, $quotaMax)
00202     {
00203         return new Zend_Service_DeveloperGarden_Request_BaseUserService_ChangeQuotaPool(
00204             $moduleId,
00205             $quotaMax
00206         );
00207     }
00208 
00215     public function getSmsQuotaInformation($environment = self::ENV_PRODUCTION)
00216     {
00217         self::checkEnvironment($environment);
00218         $moduleId = $this->_buildModuleString('Sms', $environment);
00219         $request  = $this->_getRequestModule($moduleId);
00220         return $this->getQuotaInformation($request);
00221     }
00222 
00229     public function getVoiceCallQuotaInformation($environment = self::ENV_PRODUCTION)
00230     {
00231         self::checkEnvironment($environment);
00232         $moduleId = $this->_buildModuleString('VoiceButler', $environment);
00233         $request  = $this->_getRequestModule($moduleId);
00234         return $this->getQuotaInformation($request);
00235     }
00236 
00243     public function getConfernceCallQuotaInformation($environment = self::ENV_PRODUCTION)
00244     {
00245         self::checkEnvironment($environment);
00246         $moduleId = $this->_buildModuleString('CCS', $environment);
00247         $request  = $this->_getRequestModule($moduleId);
00248         return $this->getQuotaInformation($request);
00249     }
00250 
00257     public function getLocalSearchQuotaInformation($environment = self::ENV_PRODUCTION)
00258     {
00259         self::checkEnvironment($environment);
00260         $moduleId = $this->_buildModuleString('localsearch', $environment);
00261         $request  = $this->_getRequestModule($moduleId);
00262         return $this->getQuotaInformation($request);
00263     }
00264 
00271     public function getIPLocationQuotaInformation($environment = self::ENV_PRODUCTION)
00272     {
00273         self::checkEnvironment($environment);
00274         $moduleId = $this->_buildModuleString('IPLocation', $environment);
00275         $request  = $this->_getRequestModule($moduleId);
00276         return $this->getQuotaInformation($request);
00277     }
00278 
00285     public function getQuotaInformation(
00286         Zend_Service_DeveloperGarden_Request_BaseUserService_GetQuotaInformation $request
00287     ) {
00288         $this->_checkModuleId($request->getModuleId());
00289         return $this->getSoapClient()
00290                     ->getQuotaInformation($request)
00291                     ->parse();
00292     }
00293 
00301     public function changeSmsQuotaPool($quotaMax = 0, $environment = self::ENV_PRODUCTION)
00302     {
00303         self::checkEnvironment($environment);
00304         $moduleId = $this->_buildModuleString('Sms', $environment);
00305         $request  = $this->_getChangeRequestModule($moduleId, $quotaMax);
00306         return $this->changeQuotaPool($request);
00307     }
00308 
00316     public function changeVoiceCallQuotaPool($quotaMax = 0, $environment = self::ENV_PRODUCTION)
00317     {
00318         self::checkEnvironment($environment);
00319         $moduleId = $this->_buildModuleString('VoiceButler', $environment);
00320         $request  = $this->_getChangeRequestModule($moduleId, $quotaMax);
00321         return $this->changeQuotaPool($request);
00322     }
00323 
00331     public function changeIPLocationQuotaPool($quotaMax = 0, $environment = self::ENV_PRODUCTION)
00332     {
00333         self::checkEnvironment($environment);
00334         $moduleId = $this->_buildModuleString('IPLocation', $environment);
00335         $request  = $this->_getChangeRequestModule($moduleId, $quotaMax);
00336         return $this->changeQuotaPool($request);
00337     }
00338 
00346     public function changeConferenceCallQuotaPool($quotaMax = 0, $environment = self::ENV_PRODUCTION)
00347     {
00348         self::checkEnvironment($environment);
00349         $moduleId = $this->_buildModuleString('CCS', $environment);
00350         $request  = $this->_getChangeRequestModule($moduleId, $quotaMax);
00351         return $this->changeQuotaPool($request);
00352     }
00353 
00361     public function changeLocalSearchQuotaPool($quotaMax = 0, $environment = self::ENV_PRODUCTION)
00362     {
00363         self::checkEnvironment($environment);
00364         $moduleId = $this->_buildModuleString('localsearch', $environment);
00365         $request  = $this->_getChangeRequestModule($moduleId, $quotaMax);
00366         return $this->changeQuotaPool($request);
00367     }
00368 
00375     public function changeQuotaPool(
00376         Zend_Service_DeveloperGarden_Request_BaseUserService_ChangeQuotaPool $request
00377     ) {
00378         $this->_checkModuleId($request->getModuleId());
00379         return $this->getSoapClient()
00380                     ->changeQuotaPool($request)
00381                     ->parse();
00382     }
00383 
00390     public function getAccountBalance(array $accounts = array())
00391     {
00392         $request = new Zend_Service_DeveloperGarden_Request_BaseUserService_GetAccountBalance(
00393             $accounts
00394         );
00395         return $this->getSoapClient()
00396                     ->getAccountBalance($request)
00397                     ->parse();
00398     }
00399 }
 All Data Structures Namespaces Files Functions Variables Enumerations