LudoDBUtility class with development methods for manipulation of database tables.

package LudoDB
author Alf Magne Kalleland

 Methods

Create database tables for the given classes.

createDatabaseTables(array $classNames) 

$classNames is an array of valid LudoDBModel class names.

Parameters

$classNames

array

Drop and create database tables for the given class names $classNames is an array of LudoDBModel sub classes.

dropAndCreate(array $classNames) 

This method is useful during development since it will check table references(defined in config) and drop and create the tables in the right order

Parameters

$classNames

array

Drop the database tables of the given classes.

dropDatabaseTables(array $classNames) 

Parameters

$classNames

array

To be implemented.

getAllAvailableServices() 

getTableDefinition()

getTableDefinition($className) 

Parameters

$className

To be implemented

validateConfigsOf(array $classNames) 

Parameters

$classNames

array

Return classes in right order based on dependencies (foreign keys)

getClassesRearranged(array $classNames) : array

Parameters

$classNames

array

Returns

array

Return database tables for given class names

getLudoDBModelTables(array $classNames) : array

Parameters

$classNames

array

Returns

array

Return instance of a LudoDBModel

getClassInstance($name) : \LudoDBModel

Parameters

$name

Returns

Get tables referenced by a model, i.e.

getReferencedTables(\LudoDBModel $model) : array

foreign keys.

Parameters

$model

\LudoDBModel

Returns

array

Return table names for given classes.

getTableNames($classNames) : array

Parameters

$classNames

Returns

array

Remove duplicate class names, i.e.

withDuplicatesRemoved(array $classNames) : array

classes using the same database table.

Parameters

$classNames

array

Returns

array

 Properties

 

$instances : array