ClassesBigCommerceApiBanners API

Banners_Api

Class Banners_Api

Retrieves banner data from the Banners v2 API collection. This class allows you to fetch banners and their associated details, such as name, content, location, and visibility.

Methods

get_banners

Fetches a list of banners from the Banners v2 API.

public get_banners(): array

This method retrieves the banners collection from the API and maps each banner to a simplified array format containing its relevant data such as ID, name, content, item ID, location, creation date, visibility, and more.

Return Value:

Returns an array of banners with the following keys:

  • ‘id’ (int)
  • ‘name’ (string)
  • ‘content’ (string)
  • ‘page’ (string)
  • ‘item_id’ (int)
  • ‘location’ (string)
  • ‘date_created’ (int)
  • ‘date_type’ (string)
  • ‘date_from’ (int)
  • ‘date_to’ (int)
  • ‘visible’ (bool)

Inherited methods

__construct

Constructor

public __construct(\BigCommerce\Api\Base_Client $apiClient): mixed

Initializes the API client instance to be used in making requests.

Parameters:

ParameterTypeDescription
$apiClient\BigCommerce\Api\Base_ClientThe API client to use.

__call

Magic method to call methods on the client class.

public __call(string $method, array $args): mixed

Dynamically calls methods on the client class if available. Throws an exception if the method does not exist.

Parameters:

ParameterTypeDescription
$methodstringThe method name to call.
$argsarrayThe arguments to pass to the method.

Return Value:

The result of the method call.

Throws:

If the method is not found.


get_store_hash

Retrieve the store hash from the API client configuration.

protected get_store_hash(): string

Extracts the store hash from the API client’s configuration using the host URL.

Return Value:

The store hash.



Automatically generated on 2025-01-21