Fat-Free Framework  3.3.0  Overview Class List Hierarchy
Public Member Functions | Public Attributes | Protected Attributes | List of all members
Basket Class Reference

Session-based pseudo-mapper. More...

Public Member Functions

 exists ($key)
 
 set ($key, $val)
 
 get ($key)
 
 clear ($key)
 
 find ($key=NULL, $val=NULL)
 
 findone ($key, $val)
 
 load ($key, $val)
 
 dry ()
 
 count ()
 
 save ()
 
 erase ($key, $val)
 
 reset ()
 
 drop ()
 
 copyfrom ($key)
 
 copyto ($key)
 
 checkout ()
 
 __construct ($key='basket')
 

Public Attributes

 $id
 Current item identifier.
 
 $item =array()
 Current item contents.
 
const E_Field ='Undefined field %s'
 

Protected Attributes

 $key
 Session key.
 

Detailed Description

Session-based pseudo-mapper.

Constructor & Destructor Documentation

Basket::__construct (   $key = 'basket')

Instantiate class

Returns
void
Parameters
$keystring

Member Function Documentation

Basket::checkout ( )

Check out basket contents

Returns
array
Basket::clear (   $key)

Delete field

Returns
NULL
Parameters
$keystring
Basket::copyfrom (   $key)

Hydrate item using hive array variable

Returns
NULL
Parameters
$keystring
Basket::copyto (   $key)

Populate hive array variable with item contents

Returns
NULL
Parameters
$keystring
Basket::count ( )

Return number of items in basket

Returns
int
Basket::drop ( )

Empty basket

Returns
NULL
Basket::dry ( )

Return TRUE if current item is empty/undefined

Returns
bool
Basket::erase (   $key,
  $val 
)

Erase item matching key/value pair

Returns
bool
Parameters
$keystring
$valmixed
Basket::exists (   $key)

Return TRUE if field is defined

Returns
bool
Parameters
$keystring
Basket::find (   $key = NULL,
  $val = NULL 
)

Return items that match key/value pair; If no key/value pair specified, return all items

Returns
array|FALSE
Parameters
$keystring
$valmixed
Basket::findone (   $key,
  $val 
)

Return first item that matches key/value pair

Returns
object|FALSE
Parameters
$keystring
$valmixed
Basket::get (   $key)

Retrieve value of field

Returns
scalar|FALSE
Parameters
$keystring
Basket::load (   $key,
  $val 
)

Map current item to matching key/value pair

Returns
array
Parameters
$keystring
$valmixed
Basket::reset ( )

Reset cursor

Returns
NULL
Basket::save ( )

Save current item

Returns
array
Basket::set (   $key,
  $val 
)

Assign value to field

Returns
scalar|FALSE
Parameters
$keystring
$valscalar

The documentation for this class was generated from the following file: