Public Member Functions | |
getClient ($storeId=null, $loginToken=null, $loginCaptcha=null) | |
getService ($storeId=null) | |
getGuestService () | |
getConfig () | |
getDryRun () | |
Protected Member Functions | |
_connect ($storeId=null) |
Definition at line 34 of file Service.php.
_connect | ( | $ | storeId = null |
) | [protected] |
Authorize Google Account
Definition at line 100 of file Service.php.
00101 { 00102 $client = $this->getClient($storeId); 00103 $service = new Zend_Gdata_Gbase($client); 00104 return $service; 00105 }
getClient | ( | $ | storeId = null , |
|
$ | loginToken = null , |
|||
$ | loginCaptcha = null | |||
) |
Retutn Google Base Client Instance
Definition at line 41 of file Service.php.
00042 { 00043 $user = $this->getConfig()->getAccountLogin($storeId); 00044 $pass = $this->getConfig()->getAccountPassword($storeId); 00045 00046 // Create an authenticated HTTP client 00047 $errorMsg = Mage::helper('googlebase')->__('Unable to connect to Google Base. Please, check Account settings in configuration.'); 00048 try { 00049 $client = Zend_Gdata_ClientLogin::getHttpClient($user, $pass, Zend_Gdata_Gbase::AUTH_SERVICE_NAME, null, '', $loginToken, $loginCaptcha); 00050 } catch (Zend_Gdata_App_CaptchaRequiredException $e) { 00051 throw $e; 00052 } catch (Zend_Gdata_App_HttpException $e) { 00053 Mage::throwException($errorMsg . Mage::helper('googlebase')->__('Error: %s', $e->getMessage())); 00054 } catch (Zend_Gdata_App_AuthException $e) { 00055 Mage::throwException($errorMsg . Mage::helper('googlebase')->__('Error: %s', $e->getMessage())); 00056 } 00057 00058 return $client; 00059 }
getConfig | ( | ) |
Google Base Config
Definition at line 90 of file Service.php.
00091 { 00092 return Mage::getSingleton('googlebase/config'); 00093 }
getDryRun | ( | ) |
Get Dry Run mode
Definition at line 112 of file Service.php.
00113 { 00114 return $this->getDataSetDefault('dry_run', false); 00115 }
getGuestService | ( | ) |
Retutn Google Base Anonymous Client Instance
Definition at line 80 of file Service.php.
getService | ( | $ | storeId = null |
) |
Retutn Google Base Service Instance
Reimplemented in Mage_GoogleBase_Model_Service_Item.
Definition at line 66 of file Service.php.
00067 { 00068 if (!$this->_service) { 00069 $service = $this->_connect($storeId); 00070 $this->_service = $service; 00071 } 00072 return $this->_service; 00073 }