Award
in package
Table of Contents
Properties
- $assets : array<string|int, Assets>
- $attributes : array<string|int, Attribute>
- $country : string
- $id : string
Methods
- __construct() : mixed
- Award constructor.
- getAllAssets() : array<string|int, mixed>
- Retrieves all assets associated with the object.
- getAssets() : array<string|int, mixed>|null
- Retrieves a specific assets by it name.
- getAttribute() : Attribute|null
- Get a Award attribute object by name.
- getAttributeValue() : array<string|int, mixed>|string|false
- Get the value of a Award attribute by name.
- getId() : string
- Get the Award ID.
- getOrder() : int
- Get the order of the award.
- isVisible() : bool
- Determines whether the current item is visible based on multiple conditions: - Status must be "Active" - Current country must NOT be in the list of countries of sale - Today's date must be on or after the launch date - Today's date must be on or before the expiration date
Properties
$assets
private
array<string|int, Assets>
$assets
Array of Asset objects
$attributes
private
array<string|int, Attribute>
$attributes
Array of Attribute objects
$country
private
string
$country
$id
private
string
$id
Methods
__construct()
Award constructor.
public
__construct(string $id[, int|null $blogId = null ]) : mixed
Initializes a Award object by loading Award data from the ProductsCollection.
Parameters
- $id : string
-
The unique identifier for the Award.
- $blogId : int|null = null
Tags
getAllAssets()
Retrieves all assets associated with the object.
public
getAllAssets() : array<string|int, mixed>
This method returns an array of all assets. Each asset is stored as an associative array
within the $this->assets instance variable.
Return values
array<string|int, mixed> —An associative array of all assets, where the key is the asset name and the value is the asset's details.
getAssets()
Retrieves a specific assets by it name.
public
getAssets(string $name[, bool $asArrays = false ]) : array<string|int, mixed>|null
This method searches for an asset in the $this->assets array by the provided asset name.
If an asset with the given name exists, it returns the asset's details; otherwise, it returns null.
Parameters
- $name : string
-
The name of the asset to retrieve.
- $asArrays : bool = false
Return values
array<string|int, mixed>|null —The details of the asset if found; otherwise, null.
getAttribute()
Get a Award attribute object by name.
public
getAttribute(string $name) : Attribute|null
Parameters
- $name : string
-
The name of the attribute.
Return values
Attribute|null —The Attribute object if found, or null if not found.
getAttributeValue()
Get the value of a Award attribute by name.
public
getAttributeValue(string $name) : array<string|int, mixed>|string|false
Parameters
- $name : string
-
The name of the attribute.
Return values
array<string|int, mixed>|string|false —The value of the attribute if found, or false if not found or empty.
getId()
Get the Award ID.
public
getId() : string
Return values
string —The unique identifier of the Award.
getOrder()
Get the order of the award.
public
getOrder() : int
Return values
int —The order of the award.
isVisible()
Determines whether the current item is visible based on multiple conditions: - Status must be "Active" - Current country must NOT be in the list of countries of sale - Today's date must be on or after the launch date - Today's date must be on or before the expiration date
public
isVisible() : bool
Return values
bool —True if the item is visible, false otherwise