GoogleAnalyticsProductCollection
in package
Class GoogleAnalyticsProductCollection
Table of Contents
- $items : array<string|int, GoogleAnalyticsProductInterface>
- collect() : static|GoogleAnalyticsProductCollection
- Named constructor of GoogleAnalyticsProductsDataSetCollection.
- collectFromArray() : GoogleAnalyticsProductCollection
- Named constructor of GoogleAnalyticsProductsDataSetCollection.
- toArray() : array<string|int, GoogleAnalyticsProductInterface>
- Returns the collected product list items.
- __construct() : mixed
- GoogleAnalyticsProductDataSetCollection constructor.
- add() : $this
- Adds the given product to the collection.
Properties
$items
private
array<string|int, GoogleAnalyticsProductInterface>
$items
Methods
collect()
Named constructor of GoogleAnalyticsProductsDataSetCollection.
public
static collect(array<string|int, GoogleAnalyticsProductInterface> $products) : static|GoogleAnalyticsProductCollection
Parameters
- $products : array<string|int, GoogleAnalyticsProductInterface>
-
Products data.
Return values
static|GoogleAnalyticsProductCollection —New instance.
collectFromArray()
Named constructor of GoogleAnalyticsProductsDataSetCollection.
public
static collectFromArray(array<string|int, mixed> $products) : GoogleAnalyticsProductCollection
This way allows to create the collection by passing a well formatted array as argument.
Parameters
- $products : array<string|int, mixed>
-
Array with information about the product.
Return values
GoogleAnalyticsProductCollection —toArray()
Returns the collected product list items.
public
toArray() : array<string|int, GoogleAnalyticsProductInterface>
Return values
array<string|int, GoogleAnalyticsProductInterface> —__construct()
GoogleAnalyticsProductDataSetCollection constructor.
protected
__construct(array<string|int, GoogleAnalyticsProductInterface> $products) : mixed
Protected to enforce usage of named constructor.
Parameters
- $products : array<string|int, GoogleAnalyticsProductInterface>
-
Products data.
Return values
mixed —add()
Adds the given product to the collection.
protected
add(GoogleAnalyticsProductInterface $product) : $this
Parameters
- $product : GoogleAnalyticsProductInterface
Return values
$this —Same instance for chained method calls.