Class TableAdapter
Table adapter provide an array like access to all database keys of a given type
-
Nethgui\Adapter\TableAdapter
implements
Nethgui\Adapter\AdapterInterface,
ArrayAccess,
IteratorAggregate,
Countable
Methods summary
public
|
#
__construct( Nethgui\System\DatabaseInterface $db, mixed $types = NULL, mixed $filter = NULL )
The $filter argument can be
- NULL, no filter is applied
- an array in the form ('prop1'=>'val1',...,'propN'=>'valN') where valN it's a regexp. In this case, the adapter will return only rows where all props match all associated regexp.
- a callable, filter is invoked on each row and must return a TRUE/FALSE value that determines if a record is accepted (TRUE) or not (FALSE). The filter prototype is (bool) filter($row) {};
Parameters
- $db
- used for table mapping
- $types
- The types of records to load. Can be a string or an array or NULL.
- $filter
- Can be NULL, an associative array, or callable c($key, $props) returning TRUE/FALSE value.
Throws
InvalidArgumentException
|
public
|
#
count( )
Implementation of
Countable::count()
|
public
|
|
public
mixed
|
#
get( )
Returns
mixed
Api
Implementation of
|
public
|
#
set( $value )
Api
Var
mixed $value
Implementation of
|
public
boolean
|
#
save( )
Persist the object state
Returns
boolean
See
Api
Implementation of
|
public
|
#
getIterator( )
Implementation of
IteratorAggregate::getIterator()
|
public
bool;
|
#
isModified( )
Report if the object state has been changed from the last save()
Report if the object state has been changed from the last save()
Returns
bool;
Api
Implementation of
|
public
|
#
offsetExists( $offset )
Implementation of
ArrayAccess::offsetExists()
|
public
|
#
offsetGet( $offset )
Implementation of
ArrayAccess::offsetGet()
|
public
|
#
offsetSet( $offset, $value )
Implementation of
ArrayAccess::offsetSet()
|
public
|
#
offsetUnset( $offset )
Implementation of
ArrayAccess::offsetUnset()
|
public
|
|