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

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

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

Метод Описание
GetApplicationName ( ) : string Gets the raw application name for this user.
GetClientLibraryNameAndVersion ( )
GetDefaultOAuth2Handler ( null | string $className = null ) : mixed Get the default OAuth2 Handler for this user.
GetNetworkCode ( ) : string Gets the code for the network that this user belongs to.
GetScopes ( ) : array Gets OAuth2 scopes.
GetService ( string $serviceName, string $version = null, string $server = null, SoapClientFactory $serviceFactory = null ) : SoapClient Gets the service by its service name.
GetUserAgentHeaderName ( )
SetApplicationName ( string $applicationName ) Sets the raw application name for this user.
SetNetworkCode ( string $networkCode ) Sets the code for the network that this user belongs to.
SetScopes ( $scopes ) Sets OAuth2 scopes.
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 $authenticationIniPath = null, string $applicationName = null, string $networkCode = null, string $settingsIniPath = null, array $oauth2Info = null ) The DfpUser constructor.

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

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

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

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

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

Gets the code for the network that this user belongs to.
public GetNetworkCode ( ) : string
Результат string the network code

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

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

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

Gets the service by its service name.
public GetService ( string $serviceName, string $version = null, string $server = null, SoapClientFactory $serviceFactory = null ) : SoapClient
$serviceName string the service name
$version string the version of the service to get. If null, then the default version will be used
$server string 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
Результат SoapClient the instantiated service

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

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

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

Sets the raw application name for this user.
public SetApplicationName ( string $applicationName )
$applicationName string The raw application name.

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

Sets the code for the network that this user belongs to.
public SetNetworkCode ( string $networkCode )
$networkCode string the network code

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

Sets OAuth2 scopes.
public SetScopes ( $scopes )

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 DfpUser class can be configured in one of two ways:

  1. Using an authentication 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 $authenticationIniPath = null, string $applicationName = null, string $networkCode = null, string $settingsIniPath = null, array $oauth2Info = null )
$authenticationIniPath string 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
$applicationName string the application name (required header). Will be prepended with the library name and version. Will also overwrite the applicationName entry in any INI file
$networkCode string the network code the user belongs to (optional header). Can be left null if the user only belongs to one network. Will overwrite the networkCode entry in any INI file
$settingsIniPath string the path to the settings INI file. If null, the default settings INI file will be loaded
$oauth2Info array the OAuth 2.0 information to use for requests