PHP Класс Basket

Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$id @}
$item @}
$key @}

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

Метод Описание
__construct ( $key = 'basket' ) : void Instantiate class
checkout ( ) : array Check out basket contents
clear ( $key ) : null Delete field
copyfrom ( $var ) : null Hydrate item using hive array variable
copyto ( $key ) : null Populate hive array variable with item contents
count ( ) : integer Return number of items in basket
drop ( ) : null Empty basket
dry ( ) : boolean Return TRUE if current item is empty/undefined
erase ( $key, $val ) : boolean Erase item matching key/value pair
exists ( $key ) : boolean Return TRUE if field is defined
find ( $key = NULL, $val = NULL ) : array Return items that match key/value pair; If no key/value pair specified, return all items
findone ( $key, $val ) : object | FALSE Return first item that matches key/value pair
get ( $key ) : scalar | FALSE Retrieve value of field
load ( $key, $val ) : array Map current item to matching key/value pair
reset ( ) : null Reset cursor
save ( ) : array Save current item
set ( $key, $val ) : scalar | FALSE Assign value to field

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

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

Instantiate class
public __construct ( $key = 'basket' ) : void
$key string
Результат void

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

Check out basket contents
public checkout ( ) : array
Результат array

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

Delete field
public clear ( $key ) : null
$key string
Результат null

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

Hydrate item using hive array variable
public copyfrom ( $var ) : null
$var array|string
Результат null

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

Populate hive array variable with item contents
public copyto ( $key ) : null
$key string
Результат null

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

Return number of items in basket
public count ( ) : integer
Результат integer

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

Empty basket
public drop ( ) : null
Результат null

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

Return TRUE if current item is empty/undefined
public dry ( ) : boolean
Результат boolean

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

Erase item matching key/value pair
public erase ( $key, $val ) : boolean
$key string
$val mixed
Результат boolean

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

Return TRUE if field is defined
public exists ( $key ) : boolean
$key string
Результат boolean

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

Return items that match key/value pair; If no key/value pair specified, return all items
public find ( $key = NULL, $val = NULL ) : array
$key string
$val mixed
Результат array

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

Return first item that matches key/value pair
public findone ( $key, $val ) : object | FALSE
$key string
$val mixed
Результат object | FALSE

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

Retrieve value of field
public get ( $key ) : scalar | FALSE
$key string
Результат scalar | FALSE

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

Map current item to matching key/value pair
public load ( $key, $val ) : array
$key string
$val mixed
Результат array

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

Reset cursor
public reset ( ) : null
Результат null

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

Save current item
public save ( ) : array
Результат array

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

Assign value to field
public set ( $key, $val ) : scalar | FALSE
$key string
$val scalar
Результат scalar | FALSE

Описание свойств

$id защищенное свойство

@}
protected $id

$item защищенное свойство

@}
protected $item

$key защищенное свойство

@}
protected $key