PHP Класс Payu\Component\Basket

Наследование: implements ComponentInterface, implements Iterator, implements Countable
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( )
add ( Product $product ) Add new product to basket
count ( ) : integer (PHP 5 >= 5.1.0)
Count elements of an object
current ( ) : mixed (PHP 5 >= 5.0.0)
Return the current element
getTotalPrice ( ) : double Return Total Price of Basket
key ( ) : mixed (PHP 5 >= 5.0.0)
Return the key of the current element
next ( ) : void (PHP 5 >= 5.0.0)
Move forward to next element
remove ( string $code ) Remove product from basket with code
rewind ( ) : void (PHP 5 >= 5.0.0)
Rewind the Iterator to the first element
valid ( ) : boolean (PHP 5 >= 5.0.0)
Checks if current position is valid

Описание методов

__construct() публичный Метод

public __construct ( )

add() публичный Метод

Add new product to basket
public add ( Product $product )
$product Product

count() публичный Метод

(PHP 5 >= 5.1.0)
Count elements of an object
public count ( ) : integer
Результат integer The custom count as an integer.

The return value is cast to an integer.

current() публичный Метод

(PHP 5 >= 5.0.0)
Return the current element
public current ( ) : mixed
Результат mixed Can return any type.

getTotalPrice() публичный Метод

Return Total Price of Basket
public getTotalPrice ( ) : double
Результат double

key() публичный Метод

(PHP 5 >= 5.0.0)
Return the key of the current element
public key ( ) : mixed
Результат mixed scalar on success, or null on failure.

next() публичный Метод

(PHP 5 >= 5.0.0)
Move forward to next element
public next ( ) : void
Результат void Any returned value is ignored.

remove() публичный Метод

Remove product from basket with code
public remove ( string $code )
$code string

rewind() публичный Метод

(PHP 5 >= 5.0.0)
Rewind the Iterator to the first element
public rewind ( ) : void
Результат void Any returned value is ignored.

valid() публичный Метод

(PHP 5 >= 5.0.0)
Checks if current position is valid
public valid ( ) : boolean
Результат boolean The return value will be casted to boolean and then evaluated. Returns true on success or false on failure.