PHP Class AdWordsUser, googleads-php-lib

Inheritance: extends AdsUser
Afficher le fichier Open project: googleads/googleads-php-lib Class Usage Examples

Méthodes publiques

Méthode Description
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.

Méthodes protégées

Méthode Description
InitLogs ( ) Overrides AdsUser::InitLogs(), adding an additional log for report download requests.

Method Details

GetClientCustomerId() public méthode

Gets the client customer ID for this user.
public GetClientCustomerId ( ) : string
Résultat string the client customer ID for this user

GetClientLibraryNameAndVersion() public méthode

See also: AdsUser::GetClientLibraryNameAndVersion()

GetDefaultOAuth2Handler() public méthode

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
Résultat mixed the configured OAuth2Handler class

GetDeveloperToken() public méthode

Gets the developer token for this user.
public GetDeveloperToken ( ) : string
Résultat string the developer token

GetExpressBusinessId() public méthode

Gets the AdWords Express business ID required for AdWords Express PromotionService

GetExpressPlusPageId() public méthode

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

GetScopes() public méthode

Gets OAuth2 scopes.
public GetScopes ( ) : array
Résultat array the list of OAuth2 scopes

GetService() public méthode

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
Résultat SoapClient the instantiated service

GetUserAgent() public méthode

Gets the raw user agent for this user.
public GetUserAgent ( ) : string
Résultat string The raw user agent.

GetUserAgentHeaderName() public méthode

See also: AdsUser::GetUserAgentHeaderName()

InitLogs() protected méthode

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

LoadService() public méthode

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() public méthode

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

LogDefaults() public méthode

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

LogErrors() public méthode

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

SetClientCustomerId() public méthode

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

SetDeveloperToken() public méthode

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

SetExpressBusinessId() public méthode

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

SetExpressPlusPageId() public méthode

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

SetScopes() public méthode

Sets OAuth2 scopes.
public SetScopes ( $scopes )

SetUserAgent() public méthode

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

ValidateUser() public méthode

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

__call() public méthode

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
Résultat mixed the result of the correct method call, or nothing if there is no correct method

__construct() public méthode

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