PHP Class Contao\DcaExtractor

The class parses the DCA files and stores various extracts like relations in the cache directory. This meta data can then be loaded and used in the application (e.g. the Model classes). Usage: $user = DcaExtractor::getInstance('tl_user'); if ($user->hasRelations()) { print_r($user->getRelations()); }
Inheritance: extends Controller
Show file Open project: contao/core-bundle Class Usage Examples

Protected Properties

Property Type Description
$arrFields array Fields
$arrInstances DcaExtractor[] Instances
$arrKeys array Keys
$arrMeta array Meta data
$arrOrderFields array Order fields
$arrRelations array Relations
$arrSql array SQL buffer
$arrUniqueFields array Unique fields
$blnIsDbTable boolean Database table
$strTable string Table name

Public Methods

Method Description
__clone ( ) Prevent cloning of the object (Singleton)
getDbInstallerArray ( ) : array Return an array that can be used by the database installer
getFields ( ) : array Return the fields as array
getInstance ( string $strTable ) : DcaExtractor Get one object instance per table
getKeys ( ) : array Return the keys as array
getMeta ( ) : array Return the meta data as array
getOrderFields ( ) : array Return the order fields as array
getRelations ( ) : array Return the relations as array
getUniqueFields ( ) : array Return an array of unique columns
hasFields ( ) : boolean Return true if there are fields
hasKeys ( ) : boolean Return true if there are keys
hasMeta ( ) : boolean Return true if there is meta data
hasOrderFields ( ) : boolean Return true if there are order fields
hasRelations ( ) : boolean Return true if there are relations
hasUniqueFields ( ) : boolean Return true if there are unique fields
isDbTable ( ) : boolean Return true if the extract relates to a database table

Protected Methods

Method Description
__construct ( string $strTable ) Load or create the extract
createExtract ( ) Create the extract from the DCA or the database.sql files

Method Details

__clone() final public method

Prevent cloning of the object (Singleton)
final public __clone ( )

__construct() protected method

Load or create the extract
protected __construct ( string $strTable )
$strTable string The table name

createExtract() protected method

Create the extract from the DCA or the database.sql files
protected createExtract ( )

getDbInstallerArray() public method

Return an array that can be used by the database installer
public getDbInstallerArray ( ) : array
return array The data array

getFields() public method

Return the fields as array
public getFields ( ) : array
return array The fields array

getInstance() public static method

Get one object instance per table
public static getInstance ( string $strTable ) : DcaExtractor
$strTable string The table name
return DcaExtractor The object instance

getKeys() public method

Return the keys as array
public getKeys ( ) : array
return array The keys array

getMeta() public method

Return the meta data as array
public getMeta ( ) : array
return array The meta data

getOrderFields() public method

Return the order fields as array
public getOrderFields ( ) : array
return array The order fields array

getRelations() public method

Return the relations as array
public getRelations ( ) : array
return array The relations array

getUniqueFields() public method

Return an array of unique columns
public getUniqueFields ( ) : array
return array

hasFields() public method

Return true if there are fields
public hasFields ( ) : boolean
return boolean True if there are fields

hasKeys() public method

Return true if there are keys
public hasKeys ( ) : boolean
return boolean True if there are keys

hasMeta() public method

Return true if there is meta data
public hasMeta ( ) : boolean
return boolean True if there is meta data

hasOrderFields() public method

Return true if there are order fields
public hasOrderFields ( ) : boolean
return boolean True if there are order fields

hasRelations() public method

Return true if there are relations
public hasRelations ( ) : boolean
return boolean True if there are relations

hasUniqueFields() public method

Return true if there are unique fields
public hasUniqueFields ( ) : boolean
return boolean True if there are unique fields

isDbTable() public method

Return true if the extract relates to a database table
public isDbTable ( ) : boolean
return boolean True if the extract relates to a database table

Property Details

$arrFields protected property

Fields
protected array $arrFields
return array

$arrInstances protected static property

Instances
protected static DcaExtractor[],contao $arrInstances
return DcaExtractor[]

$arrKeys protected property

Keys
protected array $arrKeys
return array

$arrMeta protected property

Meta data
protected array $arrMeta
return array

$arrOrderFields protected property

Order fields
protected array $arrOrderFields
return array

$arrRelations protected property

Relations
protected array $arrRelations
return array

$arrSql protected static property

SQL buffer
protected static array $arrSql
return array

$arrUniqueFields protected property

Unique fields
protected array $arrUniqueFields
return array

$blnIsDbTable protected property

Database table
protected bool $blnIsDbTable
return boolean

$strTable protected property

Table name
protected string $strTable
return string