PHP Class Spatie\Analytics\AnalyticsClient

Datei anzeigen Open project: spatie/laravel-analytics Class Usage Examples

Protected Properties

Property Type Description
$cache Illuminate\Contracts\Cache\Repository
$cacheLifeTimeInMinutes integer
$service Google_Service_Analytics

Public Methods

Method Description
__construct ( Google_Service_Analytics $service, Illuminate\Contracts\Cache\Repository $cache )
getAnalyticsService ( ) : Google_Service_Analytics
performQuery ( string $viewId, DateTime $startDate, DateTime $endDate, string $metrics, array $others = [] ) : array | null Query the Google Analytics Service with given parameters.
setCacheLifeTimeInMinutes ( integer $cacheLifeTimeInMinutes ) : self Set the cache time.

Protected Methods

Method Description
determineCacheName ( array $properties ) : string * Determine the cache name for the set of query properties given.

Method Details

__construct() public method

public __construct ( Google_Service_Analytics $service, Illuminate\Contracts\Cache\Repository $cache )
$service Google_Service_Analytics
$cache Illuminate\Contracts\Cache\Repository

determineCacheName() protected method

* Determine the cache name for the set of query properties given.
protected determineCacheName ( array $properties ) : string
$properties array
return string

getAnalyticsService() public method

public getAnalyticsService ( ) : Google_Service_Analytics
return Google_Service_Analytics

performQuery() public method

Query the Google Analytics Service with given parameters.
public performQuery ( string $viewId, DateTime $startDate, DateTime $endDate, string $metrics, array $others = [] ) : array | null
$viewId string
$startDate DateTime
$endDate DateTime
$metrics string
$others array
return array | null

setCacheLifeTimeInMinutes() public method

Set the cache time.
public setCacheLifeTimeInMinutes ( integer $cacheLifeTimeInMinutes ) : self
$cacheLifeTimeInMinutes integer
return self

Property Details

$cache protected_oe property

protected Repository,Illuminate\Contracts\Cache $cache
return Illuminate\Contracts\Cache\Repository

$cacheLifeTimeInMinutes protected_oe property

protected int $cacheLifeTimeInMinutes
return integer

$service protected_oe property

protected Google_Service_Analytics $service
return Google_Service_Analytics