Iterator class for LudoDBCollection

package LudoDB
author Alf Magne Kalleland

 Methods

Constructs a new LudoDBModel/LudoDBCollection

__construct() 
Inherited
inherited_from \LudoDBObject::__construct()

Return data as JSON string.

__toString() : string
Inherited
inherited_from \LudoDBObject::__toString()

Returns

string

Return data as JSON.

asJSON() : string
Inherited
inherited_from \LudoDBObject::asJSON()

Returns

string

Clear all cached config parsers

clearParsers() 
InheritedStatic
inherited_from \LudoDBObject::clearParsers()

Commit method implemented by sub classes.

commit() 
Inherited
inherited_from \LudoDBObject::commit()

Return reference to config parser.

configParser() : \LudoDBConfigParser | \LudoDBCollectionConfigParser
Inherited
inherited_from \LudoDBObject::configParser()

Returns

Return current value when iterating collection

current() : mixed
method current

Returns

mixed

Return array of values sent to constructor.

getConstructorValues() : array
Inherited
inherited_from \LudoDBObject::getConstructorValues()

Returns

array

Implemented by sub classes.

getId() : null
Inherited
inherited_from \LudoDBObject::getId()

Returns

null

LudoDBService getOnSuccessMessageFor method.

getOnSuccessMessageFor($service) : string
Inherited

By default, it returns an empty string.

inherited_from \LudoDBObject::getOnSuccessMessageFor()

Parameters

$service

Returns

string

Returns reference to all tree nodes as numeric array

getRows() : Array

Returns

Array

Return uncommitted data.

getUncommitted() : array
Inherited

This method is implemented in LudoDBModel.

inherited_from \LudoDBObject::getUncommitted()

Returns

array

Valid public services offered by this class, example "read", "delete" and "save"

getValidServices() : array
Inherited
inherited_from \LudoDBObject::getValidServices()

Returns

array

Return collection data

getValues() : array
method getValues

Returns

array

Returns true if config is defined in external file.

hasConfigInExternalFile() : bool
Inherited
inherited_from \LudoDBObject::hasConfigInExternalFile()

Returns

bool

Returns true if database table has rows where one of the given columns has one of the given values.

hasRowWith(array $columnsEqual) 
Inherited

Example:

if($this->hasRowWith(array("email" => "name@dhtmlgoodies.com"));
inherited_from \LudoDBObject::hasRowWith()

Parameters

$columnsEqual

array

Return key used for iterator.

key() : mixed

default is numeric.

method key
example function key(){ return $this->currentRow['key'] } to return key

Returns

mixed

Examples


Go to next row.

next() 

Return data for this instance.

read() : mixed
Inherited
inherited_from \LudoDBObject::read()

Returns

mixed

Rewind iterator, i.e.

rewind() 

start from beginning.

When handled by LudoDBRequestHandler no services will by default be cached.

shouldCache(string $service) : bool
Inherited

This method should be implemented by sub classes when needed.

inherited_from \LudoDBObject::shouldCache()

Parameters

$service

string

Returns

bool

Returns true when

valid() : bool

Returns

bool

Clear database cache for this instance.

clearCache() 
Inherited
inherited_from \LudoDBObject::clearCache()

Clear internal row array

clearStoredRows() 

Escape constructor arguments.

escapeArguments($values) : array
Inherited
inherited_from \LudoDBObject::escapeArguments()

Parameters

$values

Returns

array

Return config parser instance.

getConfigParserInstance() : \LudoDBConfigParser
Inherited
inherited_from \LudoDBObject::getConfigParserInstance()

Returns

Return config parser key of this class.

getConfigParserKey() : string
Inherited
inherited_from \LudoDBObject::getConfigParserKey()

Returns

string

Return rows as associated array where key is the value of one column.

getRowsAssoc($key) : array

Parameters

$key

Returns

array

On construct method which can be implemented by sub classes.

onConstruct() 
Inherited
inherited_from \LudoDBObject::onConstruct()

Return SQL handler

sqlHandler() : \LudoDBSql
Inherited
inherited_from \LudoDBObject::sqlHandler()

Returns

Append current row to stored rows.

storeRow($row) 

Parameters

$row

Execute query and get result set reference.

load() 

 Properties

 

$JSONConfig : bool
Inherited
inherited_from \LudoDBObject::$$JSONConfig
 

$arguments : array
Inherited
inherited_from \LudoDBObject::$$arguments
 

$config : array
Inherited
example examples/cities/DemoCity.php
inherited_from \LudoDBObject::$$config

Examples


 

$configParsers : array
Inherited
inherited_from \LudoDBObject::$$configParsers
 

$currentRow : array
 

$db : \LudoDB
Inherited
inherited_from \LudoDBObject::$$db
 

$parser : \LudoDBCollectionConfigParser | \LudoDBConfigParser
Inherited
inherited_from \LudoDBObject::$$parser
 

$configParserKey : string
Inherited
inherited_from \LudoDBObject::$$configParserKey
 

$dbResource : 
 

$isValid : 

has a row

 

$loaded : 
 

$position : int
 

$rows : 
 

$sql_handler : \LudoDBSql
Inherited
inherited_from \LudoDBObject::$$sql_handler
 

$valueCache : array