Config parser for LudoDBCollection

Instances of this class are created automatically by LudoDB.

package LudoDB

 Methods

Constructs new parser.

__construct(\LudoDBObject $obj, array $config) 
Inherited
inherited_from \LudoDBConfigParser::__construct()

Parameters

$config

array

Returns true when LudoDBModel can be populated/constructed by this column.

canBePopulatedBy($column) : bool
Inherited
inherited_from \LudoDBConfigParser::canBePopulatedBy()

Parameters

$column

Returns

bool

Returns true if user can read value of given column.

canReadFrom($name) : mixed
Inherited

This is for the getValues and read methods of a LudoDBModel. You will get access to column values internally using $this->getValue($columnName);

inherited_from \LudoDBConfigParser::canReadFrom()

Parameters

$name

Returns

mixed

Returns true if user can write to given column.

canWriteTo($name) : mixed
Inherited

This is for the "save" and "setValues" methods of a LudoDBModel. You can always call $this->setValue($name, $value) internally in your LudoDBModel classes.

inherited_from \LudoDBConfigParser::canWriteTo()

Parameters

$name

Returns

mixed

Return name of external class for column.

externalClassNameFor($column) : null
Inherited
inherited_from \LudoDBConfigParser::externalClassNameFor()

Parameters

$column

Returns

null

Return foreign key for a column if exists.

foreignKeyFor($column) : null
Inherited
inherited_from \LudoDBConfigParser::foreignKeyFor()

Parameters

$column

Returns

null

Return childKey config property.

getChildKey() : string | null

Returns

stringnull

Return config of a column

getColumn($column) : array | null
Inherited
inherited_from \LudoDBConfigParser::getColumn()

Parameters

$column

Returns

arraynull

Return name of column by "set" or "get" method.

getColumnByMethod($methodName) : null | string
Inherited
inherited_from \LudoDBConfigParser::getColumnByMethod()

Parameters

$methodName

Returns

nullstring

Return array of columns from config.

getColumns() : array
Inherited
inherited_from \LudoDBConfigParser::getColumns()

Returns

array

Return columns to select from joined tables prefixed by their table names.

getColumnsToSelectFromJoins() : array
Inherited
inherited_from \LudoDBConfigParser::getColumnsToSelectFromJoins()

Returns

array

Return columns to validate

getColumnsToValidate() : array
Inherited
inherited_from \LudoDBConfigParser::getColumnsToValidate()

Returns

array

Return config

getConfig() : array | null
Inherited
inherited_from \LudoDBConfigParser::getConfig()

Returns

arraynull

Return constructor params.

getConstructorParams() : array | null
Inherited
inherited_from \LudoDBConfigParser::getConstructorParams()

Returns

arraynull

Get default data for database table.

getDefaultData() : array | null
Inherited
inherited_from \LudoDBConfigParser::getDefaultData()

Returns

arraynull

Return default value of a column.

getDefaultValue($column) : null
Inherited
inherited_from \LudoDBConfigParser::getDefaultValue()

Parameters

$column

Returns

null

Return default values of all columns.

getDefaultValues() : array | null
Inherited
inherited_from \LudoDBConfigParser::getDefaultValues()

Returns

arraynull

Return foreign key config property.

getFK() : string | null

Returns

stringnull

Return file location of this class.

getFileLocation() : string
Inherited
inherited_from \LudoDBConfigParser::getFileLocation()

Returns

string

Return "get" property of a column in config, i.e.

getGetMethod($column) : null | string
Inherited

name of get method.

inherited_from \LudoDBConfigParser::getGetMethod()

Parameters

$column

Returns

nullstring

Return group by config property.

getGroupBy() : string | null

Returns

stringnull

Return name of id field.

getIdField() : string
Inherited
inherited_from \LudoDBConfigParser::getIdField()

Returns

string

Return indexed columns from config.

getIndexes() : null
Inherited
inherited_from \LudoDBConfigParser::getIndexes()

Returns

null

Return internal column name, i.e.

getInternalColName($column) : mixed
Inherited

key in column config. alias name will be translated to internal names.

inherited_from \LudoDBConfigParser::getInternalColName()

Parameters

$column

Returns

mixed

Return array of names of joined columns prefixed by their table names.

getJoinsForSQL() : array
Inherited
inherited_from \LudoDBConfigParser::getJoinsForSQL()

Returns

array

Returns ludoJS config for database columns and static columns.

getLudoJSConfig() : array
Inherited
inherited_from \LudoDBConfigParser::getLudoJSConfig()

Returns

array

Return merge config property.

getMerged() : array | null

Returns

arraynull

Return LudoDBCollection handled by the parser.

getModel() : \LudoDBModel | null

Returns

Return name of my columns prefixed by tableName + .

getMyColumnsForSQL() : array
Inherited
inherited_from \LudoDBConfigParser::getMyColumnsForSQL()

Returns

array

Return orderBy property from config.

getOrderBy() : null
Inherited
inherited_from \LudoDBConfigParser::getOrderBy()

Returns

null

Return primary key config property.

getPK() : string | null

Returns

stringnull

Return path to JSON file for default data (name is ClassName.data.json).

getPathToJsonConfigDefaultData() : string
Inherited
inherited_from \LudoDBConfigParser::getPathToJsonConfigDefaultData()

Returns

string

Return public column name.

getPublicColumnName($name) : mixed
Inherited

If "alias" is defined in config, that

inherited_from \LudoDBConfigParser::getPublicColumnName()

Parameters

$name

Returns

mixed

Return "set" property of a column in config, i.e.

getSetMethod($column) : null
Inherited

name of set method.

inherited_from \LudoDBConfigParser::getSetMethod()

Parameters

$column

Returns

null

Return static columns

getStaticColumns() : array | null
Inherited
inherited_from \LudoDBConfigParser::getStaticColumns()

Returns

arraynull

Return value of static column.

getStaticValue($column) : mixed
Inherited
inherited_from \LudoDBConfigParser::getStaticValue()

Parameters

$column

Returns

mixed

Return array of values for static columns.

getStaticValues() : array
Inherited

Name of column is the key in the returned array.

inherited_from \LudoDBConfigParser::getStaticValues()

Returns

array

Return table name

getTableName() : string

Returns

string

Return array of table names for joined columns.

getTableNamesFromJoins() : array
Inherited
inherited_from \LudoDBConfigParser::getTableNamesFromJoins()

Returns

array

Returns references to other tables as array, example array( array('table' => 'city', 'column' => 'zip'), array('table' => 'country', 'column' => 'id') )

getTableReferences() : array
Inherited
inherited_from \LudoDBConfigParser::getTableReferences()

Returns

array

Return true if any columns are defined in config.

hasColumns() : bool
Inherited
inherited_from \LudoDBConfigParser::hasColumns()

Returns

bool

Returns true if config has static columns.

hasStaticColumns() : bool
Inherited
inherited_from \LudoDBConfigParser::hasStaticColumns()

Returns

bool

Returns true if given column is from external LudoDBObject

isExternalColumn($name) : mixed
Inherited
inherited_from \LudoDBConfigParser::isExternalColumn()

Parameters

$name

Returns

mixed

Returns true if auto increment of id is specified in config.

isIdAutoIncremented() : bool
Inherited
inherited_from \LudoDBConfigParser::isIdAutoIncremented()

Returns

bool

Returns true if given column is a static column, i.e.

isStaticColumn($column) : bool
Inherited

column not defined in database which should have a static value defined in config.

inherited_from \LudoDBConfigParser::isStaticColumn()

Parameters

$column

Returns

bool

Returns true when foreign key column should be hidden from returned rows, i.e.

shouldHideForeignKeys() : bool

the hideForeignKeys config property.

Returns

bool

Return a config property by key.

getProperty($key) : null
Inherited
inherited_from \LudoDBConfigParser::getProperty()

Parameters

$key

Returns

null

Return a column property from config, example: "db", "references", "alias"

getColumnProperty($name, $property) : null
Inherited
inherited_from \LudoDBConfigParser::getColumnProperty()

Parameters

$name

$property

Returns

null

Return config from JSON file as array.

getConfigFromFile() : array
Inherited
inherited_from \LudoDBConfigParser::getConfigFromFile()

Exceptions

\Exception

Returns

array

Return db definition of a column, example: "int auto_increment not null primary key"

getDbDefinition($column) : mixed
Inherited
inherited_from \LudoDBConfigParser::getDbDefinition()

Parameters

$column

Returns

mixed

Return a LudoDBObject instance this LudoDBObject object extends.

getExtends() : \LudoDBObject
Inherited

(Only when this class extends another LudoDBObject).

inherited_from \LudoDBConfigParser::getExtends()

Returns

Return config property from external class referenced in config of the LudoDBObject of this class.

getExternalClassProperty($column, $property) : null
Inherited
inherited_from \LudoDBConfigParser::getExternalClassProperty()

Parameters

$column

$property

Returns

null

Return column name for given set or get method from mapping cache (fast lookup).

getFromMappingCache($methodName) : null
Inherited
inherited_from \LudoDBConfigParser::getFromMappingCache()

Parameters

$methodName

Returns

null

Return array of joined tables

getJoins() : null | array
Inherited
inherited_from \LudoDBConfigParser::getJoins()

Returns

nullarray

Return LudoJS config of these columns

getLudoJSOf(array $columns) : array
Inherited
inherited_from \LudoDBConfigParser::getLudoJSOf()

Parameters

$columns

array

Returns

array

Return config of this LudoDBObject with config of parent LudoDBObject.

getMergedConfigs($config1, $config2) : array
Inherited
inherited_from \LudoDBConfigParser::getMergedConfigs()

Parameters

$config1

$config2

Returns

array

Return LudoDBCollection instance

getModelInstance() : \LudoDBModel

Returns

Return path to JSON config file.

getPathToJSONConfig() : string
Inherited
inherited_from \LudoDBConfigParser::getPathToJSONConfig()

Returns

string

Return input config validated.

getValidConfig($config) : array
Inherited
inherited_from \LudoDBConfigParser::getValidConfig()

Parameters

$config

Returns

array

Return true if config for given column is defined in config.

hasColumn($columnName) : bool
Inherited
inherited_from \LudoDBConfigParser::hasColumn()

Parameters

$columnName

Returns

bool

Returns true if you have given access (read or write) to given column.

hasColumnAccess($name, $access) : mixed
Inherited
inherited_from \LudoDBConfigParser::hasColumnAccess()

Parameters

$name

$access

Returns

mixed

Save column alias to cache.

mapColumnAliases() 
Inherited
inherited_from \LudoDBConfigParser::mapColumnAliases()

Parse config.

parseConfig(array $config) 
Inherited
inherited_from \LudoDBConfigParser::parseConfig()

Parameters

$config

array

Save mapping between set and get methods and column names in internal cache for fast lookup.

saveInMappingCache($methodName, $col) : mixed
Inherited
inherited_from \LudoDBConfigParser::saveInMappingCache()

Parameters

$methodName

$col

Returns

mixed

 Properties

 

$config : array | null
Inherited
inherited_from \LudoDBConfigParser::$$config
 

$aliasMapping : array
Inherited
inherited_from \LudoDBConfigParser::$$aliasMapping
 

$columnAccessCache : array
Inherited
inherited_from \LudoDBConfigParser::$$columnAccessCache
 

$columnMappingCache : array
Inherited
inherited_from \LudoDBConfigParser::$$columnMappingCache
 

$customConstructorParams : array
Inherited
inherited_from \LudoDBConfigParser::$$customConstructorParams
 

$extensionClasses : array
Inherited
inherited_from \LudoDBConfigParser::$$extensionClasses
 

$externalCache : array
Inherited
inherited_from \LudoDBConfigParser::$$externalCache
 

$model : \LudoDBCollection
 

$myColumns : array
Inherited
inherited_from \LudoDBConfigParser::$$myColumns
 

$obj : \LudoDBObject
Inherited
inherited_from \LudoDBConfigParser::$$obj
 

$tableName : string
 

$validationColumns : array
Inherited
inherited_from \LudoDBConfigParser::$$validationColumns