GoogleConfigurationStorage
in package
Class GoogleConfigurationStorage
Table of Contents
- SCOPE_ADWORDS = 'adwords'
- SCOPE_ANALYTICS = 'analytics'
- SCOPE_AUTH = 'auth'
- SCOPE_GENERAL = 'general'
- Easy to use scopes.
- SCOPE_SHOPPING = 'shopping'
- $clientCustomerId : string
- $db : CI_DB_query_builder
- $scope : string
- $table : string
- $validScopes : array<string|int, mixed>
- __construct() : mixed
- GoogleConfigurationStorage constructor.
- get() : mixed
- Fetches a google configuration value.
- getClientCustomerId() : string
- Determines and returns the client customer id.
- getShopVersion() : string
- Returns the current shop version.
- isInstalled() : bool
- Checks if the google_configurations table exists.
- set() : $this|GoogleConfigurationStorage
- Changes the value of a google configuration option.
- _checkScope() : $this
- Checks if the given scope exists.
Constants
SCOPE_ADWORDS
public
mixed
SCOPE_ADWORDS
= 'adwords'
SCOPE_ANALYTICS
public
mixed
SCOPE_ANALYTICS
= 'analytics'
SCOPE_AUTH
public
mixed
SCOPE_AUTH
= 'auth'
SCOPE_GENERAL
Easy to use scopes.
public
mixed
SCOPE_GENERAL
= 'general'
SCOPE_SHOPPING
public
mixed
SCOPE_SHOPPING
= 'shopping'
Properties
$clientCustomerId
protected
string
$clientCustomerId
$db
protected
CI_DB_query_builder
$db
$scope
protected
string
$scope
$table
protected
string
$table
= 'google_configurations'
$validScopes
protected
array<string|int, mixed>
$validScopes
= ['general', 'auth', 'adwords', 'shopping', 'analytics']
Methods
__construct()
GoogleConfigurationStorage constructor.
public
__construct(CI_DB_query_builder $db[, string $scope = null ]) : mixed
Parameters
- $db : CI_DB_query_builder
-
Database component.
- $scope : string = null
-
(Optional) Google config scope. It is recommended to use one of the class scope constants.
Return values
mixed —get()
Fetches a google configuration value.
public
get(string $option[, string $scope = null ]) : mixed
Parameters
- $option : string
-
Configuration option. "option" field in "google_configurations" table.
- $scope : string = null
-
(Optional) Google config scope. It is recommended to use one of the class scope constants.
Return values
mixed —getClientCustomerId()
Determines and returns the client customer id.
public
getClientCustomerId() : string
Return values
string —getShopVersion()
Returns the current shop version.
public
getShopVersion() : string
Return values
string —isInstalled()
Checks if the google_configurations table exists.
public
isInstalled() : bool
Return values
bool —set()
Changes the value of a google configuration option.
public
set(string $option, mixed $value[, string $scope = null ]) : $this|GoogleConfigurationStorage
Parameters
- $option : string
-
Name of configuration option.
- $value : mixed
-
New value.
- $scope : string = null
-
(Optional) Google config scope. It is recommended to use one of the class scope constants.
Return values
$this|GoogleConfigurationStorage —Same instance for chained method calls.
_checkScope()
Checks if the given scope exists.
protected
_checkScope(string $scope) : $this
Parameters
- $scope : string
-
Google config scope. Must be either "general", "adwords" or "analytics".
Return values
$this —Same instance for chained method calls.