Base class for LudoDBModel and LudoDBCollection

package LudoDB
author Alf Magne Kalleland

 Methods

Constructs a new LudoDBModel/LudoDBCollection

__construct() 

Return data as JSON string.

__toString() : string

Returns

string

Return data as JSON.

asJSON() : string

Returns

string

Clear all cached config parsers

clearParsers() 
Static

Commit method implemented by sub classes.

commit() 

Return reference to config parser.

configParser() : \LudoDBConfigParser | \LudoDBCollectionConfigParser

Return array of values sent to constructor.

getConstructorValues() : array

Returns

array

Implemented by sub classes.

getId() : null

Returns

null

LudoDBService getOnSuccessMessageFor method.

getOnSuccessMessageFor($service) : string

By default, it returns an empty string.

Parameters

$service

Returns

string

Return uncommitted data.

getUncommitted() : array

This method is implemented in LudoDBModel.

Returns

array

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

getValidServices() : array

Returns

array

Implemented by sub classes.

getValues() : mixed

Returns

mixed

Returns true if config is defined in external file.

hasConfigInExternalFile() : bool

Returns

bool

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

hasRowWith(array $columnsEqual) 

Example:

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

Parameters

$columnsEqual

array

Return data for this instance.

read() : mixed

Returns

mixed

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

shouldCache(string $service) : bool

This method should be implemented by sub classes when needed.

Parameters

$service

string

Returns

bool

Clear database cache for this instance.

clearCache() 

Escape constructor arguments.

escapeArguments($values) : array

Parameters

$values

Returns

array

Return config parser instance.

getConfigParserInstance() : \LudoDBConfigParser

Return config parser key of this class.

getConfigParserKey() : string

Returns

string

On construct method which can be implemented by sub classes.

onConstruct() 

Return SQL handler

sqlHandler() : \LudoDBSql

Returns

 Properties

 

$JSONConfig : bool
 

$arguments : array
 

$config : array
example examples/cities/DemoCity.php

Examples


 

$configParsers : array
 

$db : \LudoDB
   

$configParserKey : string
 

$sql_handler : \LudoDBSql