ProductPriceReader

Implements \ProductPriceReaderInterface

Class ProductPriceReader

package

Default

Methods

ProductPriceReader constructor.

__construct(\CI_DB_query_builder $db) 

Arguments

$db

\CI_DB_query_builder

Finds the nearest number.

_findNearestLower(array $numbers, float $search) : float|null

If the searched number is between two others, the lower value is returned.

Arguments

$numbers

array

Numbers to be searched

$search

float

Number to be searched.

Response

float|null

Nearest (or lower nearest) number.

Fetches product price data by the given id.

fetchById(\IdType $productId) : array|null

Arguments

$productId

\IdType

product id.

Response

array|null

Raw data of product prices.

Fetches product price data by the given conditions.

fetchByQuantity(\IdType $productId, \IdType $customerGroupId, \DecimalType $quantity) : array|null

Arguments

$productId

\IdType

Product id.

$customerGroupId

\IdType

Customer group id.

$quantity

\DecimalType

Quantity.

Response

array|null

Raw data of product prices.

Properties

db

db : \CI_DB_query_builder
var

Type(s)

\CI_DB_query_builder