コード例 #1
0
 /**
  * The constructor for the AdWords API SOAP client factory.
  *
  * @param AdsUser $user the user which the client will use for credentials
  * @param string $server the server to generate clients for
  * @param bool $validateOnly if the clients should be created in validateOnly mode
  * @param bool $partialFailure if the service should be created in partialFailure mode
  */
 public function __construct(AdsUser $user, $server, $validateOnly, $partialFailure)
 {
     if ($user->GetHeaderValue('clientEmail') != null) {
         throw new \Exception('The header "clientEmail" is not compatible with versions v201109 and later. Use clientCustomerId instead.');
     }
     $headerOverrides = array();
     if (isset($validateOnly) || isset($partialFailure)) {
         $headerOverrides['validateOnly'] = $validateOnly;
         $headerOverrides['partialFailure'] = $partialFailure;
     }
     parent::__construct($user, $server, 'adwords', $headerOverrides);
 }
コード例 #2
0
ファイル: AdsUser.php プロジェクト: Katoga/g-ads
 /**
  * Gets the service by its service name.
  *
  * @param string $serviceName the service name
  * @param SoapClientFactory $serviceFactory the service factory
  * @return SoapClient the instantiated service
  */
 public function GetServiceSoapClient($serviceName, SoapClientFactory $serviceFactory)
 {
     return $serviceFactory->GenerateSoapClient($serviceName);
 }