Example #1
0
 /**
  * Returns the connector of the google contacts
  * @return Google_Contacts_Connector
  */
 public function getTargetConnector()
 {
     $oauthConnector = new Google_Oauth_Connector(Google_Utils_Helper::getCallbackUrl(array('module' => 'Google', 'sourcemodule' => $this->getSourceType()), array('operation' => 'sync')));
     $client = $oauthConnector->getHttpClient($this->getSourceType());
     $connector = new Google_Contacts_Connector($client);
     $connector->setSynchronizeController($this);
     return $connector;
 }
Example #2
0
 /**
  * Returns the connector of the google contacts
  * @return Google_Contacts_Connector
  */
 public function getTargetConnector()
 {
     $oauth2Connector = new Google_Oauth2_Connector($this->getSourceType(), $this->user->id);
     $oauth2Connection = $oauth2Connector->authorize();
     $connector = new Google_Contacts_Connector($oauth2Connection);
     $connector->setSynchronizeController($this);
     return $connector;
 }