GoogleAnalyticsProductImpressionSerializer
in package
Class GoogleAnalyticsProductImpressionSerializer
Table of Contents
- encode() : string
- Encodes the given product impression value object into a json string.
- serialize() : array<string|int, mixed>
- Serializes the given product impression value object into an array.
- _tryToSet() : $this
- Tries to set a new property, if the value is not null.
Methods
encode()
Encodes the given product impression value object into a json string.
public
encode(GoogleAnalyticsProductImpressionInterface $productImpression, int $option) : string
Parameters
- $productImpression : GoogleAnalyticsProductImpressionInterface
-
Product impression to be encoded.
- $option : int
-
Option flag, use a "JSON_" constant flag.
Return values
string —Json encoded product impression.
serialize()
Serializes the given product impression value object into an array.
public
serialize(GoogleAnalyticsProductImpressionInterface $productImpression) : array<string|int, mixed>
Parameters
- $productImpression : GoogleAnalyticsProductImpressionInterface
-
Product impression to be serialized.
Return values
array<string|int, mixed> —Serialized product impression.
_tryToSet()
Tries to set a new property, if the value is not null.
protected
_tryToSet(GoogleAnalyticsProductImpressionInterface $productImpression, string $property, array<string|int, mixed> &$data[, string|null $as = null ]) : $this
Parameters
- $productImpression : GoogleAnalyticsProductImpressionInterface
-
Product value object to be serialized.
- $property : string
-
Name of properties accessor method.
- $data : array<string|int, mixed>
-
Final serialized data array.
- $as : string|null = null
-
(Optional) Json property name, $property if null.
Return values
$this —Same instance for chained method calls.