GoogleAnalyticsCombinedProductId
in package
implements
GoogleAnalyticsCombinedProductIdInterface
Class GoogleAnalyticsCombinedProductId
Interfaces, Classes and Traits
- GoogleAnalyticsCombinedProductIdInterface
- Interface GoogleAnalyticsCombinedProductIdInterface
Table of Contents
- $attributeIds : GoogleAnalyticsProductAttributeCollection|null
- $attributeOnlyRegex : string
- $combinedPropertyAttributeRegex : string
- $productId : int
- $propertyCombinationId : int|null
- $propertyOnlyRegex : string
- __construct() : mixed
- GoogleAnalyticsCombinedProductId constructor.
- attributeIds() : GoogleAnalyticsProductAttributeCollection|null
- Returns the attribute ids.
- containsAttributeIds() : bool
- Checks if only attribute ids are present.
- containsBoth() : bool
- Checks if optional property combination id and attribute ids are present.
- containsOnlyProductId() : bool
- Checks if only product id is present.
- containsPropertyId() : bool
- Checks if just property combination id is present.
- create() : GoogleAnalyticsCombinedProductId
- Named constructor of GoogleAnalyticsCombinedProductId.
- productId() : int
- Returns the product id.
- propertyId() : int|null
- Returns the property combination id.
- _createAttributesFromIdString() : GoogleAnalyticsProductAttributeCollection
- Creates attributes from the given id string.
Properties
$attributeIds
protected
GoogleAnalyticsProductAttributeCollection|null
$attributeIds
$attributeOnlyRegex
protected
static string
$attributeOnlyRegex
= '/^\d+(\{\d+\}\d)+$/'
$combinedPropertyAttributeRegex
protected
static string
$combinedPropertyAttributeRegex
= '/^\d+(\{\d+\}(\d))+x\d+$/'
$productId
protected
int
$productId
$propertyCombinationId
protected
int|null
$propertyCombinationId
$propertyOnlyRegex
protected
static string
$propertyOnlyRegex
= '/^\d+x(\d+)$/'
Methods
__construct()
GoogleAnalyticsCombinedProductId constructor.
public
__construct(NonEmptyStringType $combinedId) : mixed
It is recommended to use the named constructor ::create(string $combinedId).
Parameters
- $combinedId : NonEmptyStringType
-
Product id combination (including attributes and properties).
Return values
mixed —attributeIds()
Returns the attribute ids.
public
attributeIds() : GoogleAnalyticsProductAttributeCollection|null
Return values
GoogleAnalyticsProductAttributeCollection|null —Attribute ids.
containsAttributeIds()
Checks if only attribute ids are present.
public
containsAttributeIds() : bool
Return values
bool —True if only attribute ids are present.
containsBoth()
Checks if optional property combination id and attribute ids are present.
public
containsBoth() : bool
Return values
bool —True if optional property combination id and attribute ids are present.
containsOnlyProductId()
Checks if only product id is present.
public
containsOnlyProductId() : bool
Return values
bool —True if only product id is present.
containsPropertyId()
Checks if just property combination id is present.
public
containsPropertyId() : bool
Return values
bool —True if just property combination id is present.
create()
Named constructor of GoogleAnalyticsCombinedProductId.
public
static create(string $combinedId) : GoogleAnalyticsCombinedProductId
Parameters
- $combinedId : string
-
Product id combination (including attributes and properties).
Return values
GoogleAnalyticsCombinedProductId —New instance.
productId()
Returns the product id.
public
productId() : int
Return values
int —Product id.
propertyId()
Returns the property combination id.
public
propertyId() : int|null
Return values
int|null —Property combination id.
_createAttributesFromIdString()
Creates attributes from the given id string.
protected
_createAttributesFromIdString(string $idString) : GoogleAnalyticsProductAttributeCollection
The attributes are created by the id substring, start with {.
Parameters
- $idString : string
-
Combined id string.
Return values
GoogleAnalyticsProductAttributeCollection —Product attributes.