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
Afficher le fichier Open project: contao/core-bundle Class Usage Examples

Protected Properties

Свойство 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

Méthodes publiques

Méthode 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

Méthodes protégées

Méthode 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 méthode

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

__construct() protected méthode

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

createExtract() protected méthode

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

getDbInstallerArray() public méthode

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

getFields() public méthode

Return the fields as array
public getFields ( ) : array
Résultat array The fields array

getInstance() public static méthode

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

getKeys() public méthode

Return the keys as array
public getKeys ( ) : array
Résultat array The keys array

getMeta() public méthode

Return the meta data as array
public getMeta ( ) : array
Résultat array The meta data

getOrderFields() public méthode

Return the order fields as array
public getOrderFields ( ) : array
Résultat array The order fields array

getRelations() public méthode

Return the relations as array
public getRelations ( ) : array
Résultat array The relations array

getUniqueFields() public méthode

Return an array of unique columns
public getUniqueFields ( ) : array
Résultat array

hasFields() public méthode

Return true if there are fields
public hasFields ( ) : boolean
Résultat boolean True if there are fields

hasKeys() public méthode

Return true if there are keys
public hasKeys ( ) : boolean
Résultat boolean True if there are keys

hasMeta() public méthode

Return true if there is meta data
public hasMeta ( ) : boolean
Résultat boolean True if there is meta data

hasOrderFields() public méthode

Return true if there are order fields
public hasOrderFields ( ) : boolean
Résultat boolean True if there are order fields

hasRelations() public méthode

Return true if there are relations
public hasRelations ( ) : boolean
Résultat boolean True if there are relations

hasUniqueFields() public méthode

Return true if there are unique fields
public hasUniqueFields ( ) : boolean
Résultat boolean True if there are unique fields

isDbTable() public méthode

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

Property Details

$arrFields protected_oe property

Fields
protected array $arrFields
Résultat array

$arrInstances protected_oe static_oe property

Instances
protected static DcaExtractor[],contao $arrInstances
Résultat DcaExtractor[]

$arrKeys protected_oe property

Keys
protected array $arrKeys
Résultat array

$arrMeta protected_oe property

Meta data
protected array $arrMeta
Résultat array

$arrOrderFields protected_oe property

Order fields
protected array $arrOrderFields
Résultat array

$arrRelations protected_oe property

Relations
protected array $arrRelations
Résultat array

$arrSql protected_oe static_oe property

SQL buffer
protected static array $arrSql
Résultat array

$arrUniqueFields protected_oe property

Unique fields
protected array $arrUniqueFields
Résultat array

$blnIsDbTable protected_oe property

Database table
protected bool $blnIsDbTable
Résultat boolean

$strTable protected_oe property

Table name
protected string $strTable
Résultat string