[ Index ]

PHP Cross Reference of Web Application Component Toolkit

title

Body

[close]

/framework/util/ -> arraydataset.inc.php (summary)

(no description)

Version: $Id: arraydataset.inc.php,v 1.20 2004/06/15 03:03:50 jeffmoore Exp $
File Size: 252 lines (7 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

arraydataset:: (19 methods):
  arraydataset()
  isempty()
  importdatasetasarray()
  exportdatasetasarray()
  getdataset()
  get()
  set()
  remove()
  removeall()
  import()
  merge()
  export()
  isdatasource()
  hasproperty()
  getpropertylist()
  registerfilter()
  prepare()
  reset()
  next()


Class: arraydataset  - X-Ref

Provides an Iterator over a Recordset of DataSpaces.

The recordset/dataset is made up of rows accessed using the Iterator and
DataSpace interfaces. It should be exactly analagous to a WACT database
recordset.

e.g.
<code>
$dataset = array (
array ('username'=>'jdoe','email'=>'jdoe@hotmail.com'),
array ('username'=>'rsmith','email'=>'rsmith@cure.org'),
array ('username'=>'nclark','email'=>'nclark@yahoo.com'),
);
$ds = new ArrayDataSet($dataset);
while ($ds->next()) {
do_something($ds->get(username));
}
</code>
arraydataset($array)   X-Ref

param: array An array of arrays representing a Recordset

isempty()   X-Ref
Check whether the current row is empty


importdatasetasarray($dataset)   X-Ref
Sets up a Recordset from an array of row arrays

Replaces the current Recordset and resets the internal cursor
param: array $dataset

exportdatasetasarray()   X-Ref
Export the Recordset as an array of row arrays


getdataset()   X-Ref
Alias for exportDataSetAsArray


get($name)   X-Ref
Return an item from the current row by key/name

param: string $name The item key/name
return: mixed

set($name, $value)   X-Ref
Set the value of an item in the current row

param: string $name The item key/name
param: mixed $value The item value

remove($name)   X-Ref
No description

removeall()   X-Ref
No description

import($array)   X-Ref
Import a dictionary/hash/map that will replace the current row

param: array $array

merge($array)   X-Ref
Append a dictionary/hash/map of key value pairs to the current row

Existing keys are overwritten
param: array $array

export()   X-Ref
Export the current row/dataspace as a dictionary/hash/map

return: array

isdatasource()   X-Ref
No description

hasproperty($name)   X-Ref
No description

getpropertylist()   X-Ref
No description

registerfilter(&$filter)   X-Ref
Register a filter object on the current row.

Filters can be used to transform rows. The filter object must provide a
doFilter(&$array) method that filters values from the current row. The
filter is passed a copy of the current row.
param: object $filter

prepare()   X-Ref
Filter the current row as apt. Works on a copy of the row.


reset()   X-Ref
Reset the internal cursor to the beginning of the Recordset

next() must be called after reset() to access a valid row via the
DataSpace methods.

next()   X-Ref
Moves the internal cursor to the next row of the Recordset

Sets the row accessed by the DataSpace interface to the next row of the
Recordset. Returns TRUE if there is another row in the recordset, FALSE
otherwise. Calls prepare().



Generated: Sun Nov 28 19:36:09 2004 Cross-referenced by PHPXref 0.5