PHP Класс AdWordsUser, googleads-php-lib

Наследование: extends AdsUser
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
GetClientCustomerId ( ) : string Gets the client customer ID for this user.
GetClientLibraryNameAndVersion ( )
GetDefaultOAuth2Handler ( null | string $className = null ) : mixed Get the default OAuth2 Handler for this user.
GetDeveloperToken ( ) : string Gets the developer token for this user.
GetExpressBusinessId ( ) Gets the AdWords Express business ID required for AdWords Express PromotionService
GetExpressPlusPageId ( ) Gets the Google My Business page ID used by AdWords Express PromotionService
GetScopes ( ) : array Gets OAuth2 scopes.
GetService ( string $serviceName, string | null $version = null, string | null $server = null, SoapClientFactory $serviceFactory = null, boolean | null $validateOnly = null, boolean | null $partialFailure = null ) : SoapClient Gets the service by its service name and group.
GetUserAgent ( ) : string Gets the raw user agent for this user.
GetUserAgentHeaderName ( )
LoadService ( string $serviceName, string | null $version = null ) Loads the classes within a service, so they can be used before the service is constructed.
LogAll ( ) Overrides AdsUser::LogAll(), setting an additional log level for report download requests.
LogDefaults ( ) Overrides AdsUser::LogDefaults(), setting an additional log level for report download requests.
LogErrors ( ) Overrides AdsUser::LogErrors(), setting an additional log level for report download requests.
SetClientCustomerId ( string $clientCustomerId ) Sets the client customer ID for this user.
SetDeveloperToken ( string $developerToken ) Sets the developer token for this user.
SetExpressBusinessId ( $businessId ) Sets the AdWords Express business ID required for AdWords Express PromotionService
SetExpressPlusPageId ( $pageId ) Sets the Google My Business page ID used by AdWords Express PromotionService
SetScopes ( $scopes ) Sets OAuth2 scopes.
SetUserAgent ( string $userAgent ) Sets the raw user agent for this user.
ValidateUser ( ) Validates the user and throws a validation error if there are any errors.
__call ( string $name, array $arguments ) : mixed Handles calls to undefined methods.
__construct ( string | null $authenticationIniPath = null, string | null $developerToken = null, string | null $userAgent = null, string | null $clientCustomerId = null, string | null $settingsIniPath = null, array | null $oauth2Info = null ) The AdWordsUser constructor.

Защищенные методы

Метод Описание
InitLogs ( ) Overrides AdsUser::InitLogs(), adding an additional log for report download requests.

Описание методов

GetClientCustomerId() публичный Метод

Gets the client customer ID for this user.
public GetClientCustomerId ( ) : string
Результат string the client customer ID for this user

GetClientLibraryNameAndVersion() публичный Метод

См. также: AdsUser::GetClientLibraryNameAndVersion()

GetDefaultOAuth2Handler() публичный Метод

Get the default OAuth2 Handler for this user.
public GetDefaultOAuth2Handler ( null | string $className = null ) : mixed
$className null | string the name of the oauth2Handler class or null
Результат mixed the configured OAuth2Handler class

GetDeveloperToken() публичный Метод

Gets the developer token for this user.
public GetDeveloperToken ( ) : string
Результат string the developer token

GetExpressBusinessId() публичный Метод

Gets the AdWords Express business ID required for AdWords Express PromotionService

GetExpressPlusPageId() публичный Метод

Gets the Google My Business page ID used by AdWords Express PromotionService

GetScopes() публичный Метод

Gets OAuth2 scopes.
public GetScopes ( ) : array
Результат array the list of OAuth2 scopes

GetService() публичный Метод

Gets the service by its service name and group.
public GetService ( string $serviceName, string | null $version = null, string | null $server = null, SoapClientFactory $serviceFactory = null, boolean | null $validateOnly = null, boolean | null $partialFailure = null ) : SoapClient
$serviceName string the service name
$version string | null the version of the service to get. If null, then the default version will be used
$server string | null the server to make the request to. If null, then the default server will be used
$serviceFactory SoapClientFactory the factory to create the client. If null, then the built-in SOAP client factory will be used
$validateOnly boolean | null if the service should be created in validateOnly mode
$partialFailure boolean | null if the service should be created in partialFailure mode
Результат SoapClient the instantiated service

GetUserAgent() публичный Метод

Gets the raw user agent for this user.
public GetUserAgent ( ) : string
Результат string The raw user agent.

GetUserAgentHeaderName() публичный Метод

См. также: AdsUser::GetUserAgentHeaderName()

InitLogs() защищенный Метод

Overrides AdsUser::InitLogs(), adding an additional log for report download requests.
protected InitLogs ( )

LoadService() публичный Метод

Loads the classes within a service, so they can be used before the service is constructed.
public LoadService ( string $serviceName, string | null $version = null )
$serviceName string the service name
$version string | null the version of the service to get. If null, then the default version will be used

LogAll() публичный Метод

Overrides AdsUser::LogAll(), setting an additional log level for report download requests.
public LogAll ( )

LogDefaults() публичный Метод

Overrides AdsUser::LogDefaults(), setting an additional log level for report download requests.
public LogDefaults ( )

LogErrors() публичный Метод

Overrides AdsUser::LogErrors(), setting an additional log level for report download requests.
public LogErrors ( )

SetClientCustomerId() публичный Метод

Sets the client customer ID for this user.
public SetClientCustomerId ( string $clientCustomerId )
$clientCustomerId string the client customer ID for this user

SetDeveloperToken() публичный Метод

Sets the developer token for this user.
public SetDeveloperToken ( string $developerToken )
$developerToken string the developer token

SetExpressBusinessId() публичный Метод

Sets the AdWords Express business ID required for AdWords Express PromotionService
public SetExpressBusinessId ( $businessId )

SetExpressPlusPageId() публичный Метод

Sets the Google My Business page ID used by AdWords Express PromotionService
public SetExpressPlusPageId ( $pageId )

SetScopes() публичный Метод

Sets OAuth2 scopes.
public SetScopes ( $scopes )

SetUserAgent() публичный Метод

Sets the raw user agent for this user.
public SetUserAgent ( string $userAgent )
$userAgent string The raw user agent.

ValidateUser() публичный Метод

Validates the user and throws a validation error if there are any errors.
public ValidateUser ( )

__call() публичный Метод

Handles calls to undefined methods.
public __call ( string $name, array $arguments ) : mixed
$name string the name of the method being called
$arguments array the arguments passed to the method
Результат mixed the result of the correct method call, or nothing if there is no correct method

__construct() публичный Метод

The AdWordsUser class can be configured in one of two ways:

  1. Using an authenitcation INI file
  2. Using supplied credentials

If an authentication INI file is provided and successfully loaded, those values will be used unless a corresponding parameter overwrites it. If the authentication INI file is not provided (e.g. it is null) the class will attempt to load the default authentication file at the path of "../auth.ini" relative to this file's directory. Any corresponding parameter, which is not null, will, however, overwrite any parameter loaded from the default INI.

Likewise, if a custom settings INI file is not provided, the default settings INI file will be loaded from the path of "../settings.ini" relative to this file's directory.

public __construct ( string | null $authenticationIniPath = null, string | null $developerToken = null, string | null $userAgent = null, string | null $clientCustomerId = null, string | null $settingsIniPath = null, array | null $oauth2Info = null )
$authenticationIniPath string | null the absolute path to the authentication INI or relative to the current directory (cwd). If null, the default authentication INI file will attempt to be loaded
$developerToken string | null the developer token (required header). Will overwrite the developer token entry loaded from any INI file
$userAgent string | null the user agent name (required header). Will be prepended with the library name and version. Will overwrite the userAgent entry loaded from any INI file
$clientCustomerId string | null the client customer ID to make the request against (optional header). Will overwrite the clientCustomerId entry loaded from any INI file
$settingsIniPath string | null the path to the settings INI file. If null, the default settings INI file will be loaded
$oauth2Info array | null the OAuth 2.0 information to use for requests