PHP Class Payu\Component\Basket

Inheritance: implements ComponentInterface, implements Iterator, implements Countable
Datei anzeigen Open project: paranoiaproject/payuclient Class Usage Examples

Public Methods

Method Description
__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

Method Details

__construct() public method

public __construct ( )

add() public method

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

count() public method

(PHP 5 >= 5.1.0)
Count elements of an object
public count ( ) : integer
return integer The custom count as an integer.

The return value is cast to an integer.

current() public method

(PHP 5 >= 5.0.0)
Return the current element
public current ( ) : mixed
return mixed Can return any type.

getTotalPrice() public method

Return Total Price of Basket
public getTotalPrice ( ) : double
return double

key() public method

(PHP 5 >= 5.0.0)
Return the key of the current element
public key ( ) : mixed
return mixed scalar on success, or null on failure.

next() public method

(PHP 5 >= 5.0.0)
Move forward to next element
public next ( ) : void
return void Any returned value is ignored.

remove() public method

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

rewind() public method

(PHP 5 >= 5.0.0)
Rewind the Iterator to the first element
public rewind ( ) : void
return void Any returned value is ignored.

valid() public method

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