PHP Class Contao\DC_Table

Inheritance: extends DataContainer, implements listable, implements editable
Afficher le fichier Open project: contao/core-bundle Class Usage Examples

Protected Properties

Свойство Type Description
$arrModule array The current back end module
$bid string ID of the button container
$blnCreateNewVersion boolean True if a new version has to be created
$ctable array Names of the child tables
$current array IDs of all records that are currently displayed
$firstOrderBy string First sorting field
$limit string Limit (database query)
$orderBy array Order by (database query)
$ptable string Name of the parent table
$set array Fields of a new or duplicated record
$total string Total (database query)
$treeView boolean Show the current table as tree

Méthodes publiques

Méthode Description
__construct ( string $strTable, array $arrModule = [] ) Initialize the object
__get ( string $strKey ) : mixed Return an object property
__set ( string $strKey, mixed $varValue ) Set an object property
ajaxTreeView ( integer $id, integer $level ) : string Generate a particular subpart of the tree and return it as HTML string
copy ( boolean $blnDoNotRedirect = false ) : integer | boolean Duplicate a particular record of the current table
copyAll ( ) Move all selected records
create ( array $set = [] ) Insert a new row into a database table
cut ( boolean $blnDoNotRedirect = false ) Assign a new position to an existing record
cutAll ( ) Move all selected records
delete ( boolean $blnDoNotRedirect = false ) Delete a record of the current table table and save it to tl_undo
deleteAll ( ) Delete all selected records
deleteChilds ( string $table, integer $id, array &$delete ) Recursively get all related table names and records
edit ( integer $intId = null, integer $ajaxId = null ) : string Auto-generate a form to edit the current database record
editAll ( integer $intId = null, integer $ajaxId = null ) : string Auto-generate a form to edit all records that are currently shown
getPalette ( ) : string Return the name of the current palette
move ( ) Change the order of two neighbour database records
overrideAll ( ) : string Auto-generate a form to override all records that are currently shown
show ( ) : string Return all non-excluded fields of a record as HTML table
showAll ( ) : string List all records of a particular table
undo ( ) Restore one or more deleted records

Méthodes protégées

Méthode Description
copyChilds ( string $table, integer $insertID, integer $id, integer $parentId ) Duplicate all child records of a duplicated record
filterMenu ( integer $intFilterPanel ) : string Generate the filter panel and return it as HTML string
formatCurrentValue ( string $field, mixed $value, integer $mode ) : string Return the formatted group header as string
formatGroupHeader ( string $field, mixed $value, integer $mode, array $row ) : string Return the formatted group header as string
generateTree ( string $table, integer $id, array $arrPrevNext, boolean $blnHasSorting, integer $intMargin, array $arrClipboard = null, boolean $blnCircularReference = false, boolean $protectedPage = false, boolean $blnNoRecursion = false, array $arrFound = [] ) : string Recursively generate the tree and return it as HTML string
getNewPosition ( string $mode, integer $pid = null, boolean $insertInto = false ) Calculate the new position of a moved or inserted record
limitMenu ( boolean $blnOptional = false ) : string Return a select menu to limit results
listView ( ) : string List all records of the current table and return them as HTML string
paginationMenu ( ) : string Return a pagination menu to browse results
panel ( ) : string Build the sort panel and return it as string
parentView ( ) : string Show header of the parent table and list all records of the current table
reviseTable ( ) Delete all incomplete and unrelated records
save ( mixed $varValue ) Save the current value
searchMenu ( ) : string Return a search form that allows to search results using regular expressions
sortMenu ( ) : string Return a select menu that allows to sort results by a particular field
treeView ( ) : string List all records of the current table as tree and return them as HTML string

Method Details

__construct() public méthode

Initialize the object
public __construct ( string $strTable, array $arrModule = [] )
$strTable string
$arrModule array

__get() public méthode

Return an object property
public __get ( string $strKey ) : mixed
$strKey string
Résultat mixed

__set() public méthode

Set an object property
public __set ( string $strKey, mixed $varValue )
$strKey string
$varValue mixed

ajaxTreeView() public méthode

Generate a particular subpart of the tree and return it as HTML string
public ajaxTreeView ( integer $id, integer $level ) : string
$id integer
$level integer
Résultat string

copy() public méthode

Duplicate a particular record of the current table
public copy ( boolean $blnDoNotRedirect = false ) : integer | boolean
$blnDoNotRedirect boolean
Résultat integer | boolean

copyAll() public méthode

Move all selected records
public copyAll ( )

copyChilds() protected méthode

Duplicate all child records of a duplicated record
protected copyChilds ( string $table, integer $insertID, integer $id, integer $parentId )
$table string
$insertID integer
$id integer
$parentId integer

create() public méthode

Insert a new row into a database table
public create ( array $set = [] )
$set array

cut() public méthode

Assign a new position to an existing record
public cut ( boolean $blnDoNotRedirect = false )
$blnDoNotRedirect boolean

cutAll() public méthode

Move all selected records
public cutAll ( )

delete() public méthode

Delete a record of the current table table and save it to tl_undo
public delete ( boolean $blnDoNotRedirect = false )
$blnDoNotRedirect boolean

deleteAll() public méthode

Delete all selected records
public deleteAll ( )

deleteChilds() public méthode

Recursively get all related table names and records
public deleteChilds ( string $table, integer $id, array &$delete )
$table string
$id integer
$delete array

edit() public méthode

Auto-generate a form to edit the current database record
public edit ( integer $intId = null, integer $ajaxId = null ) : string
$intId integer
$ajaxId integer
Résultat string

editAll() public méthode

Auto-generate a form to edit all records that are currently shown
public editAll ( integer $intId = null, integer $ajaxId = null ) : string
$intId integer
$ajaxId integer
Résultat string

filterMenu() protected méthode

Generate the filter panel and return it as HTML string
protected filterMenu ( integer $intFilterPanel ) : string
$intFilterPanel integer
Résultat string

formatCurrentValue() protected méthode

Return the formatted group header as string
protected formatCurrentValue ( string $field, mixed $value, integer $mode ) : string
$field string
$value mixed
$mode integer
Résultat string

formatGroupHeader() protected méthode

Return the formatted group header as string
protected formatGroupHeader ( string $field, mixed $value, integer $mode, array $row ) : string
$field string
$value mixed
$mode integer
$row array
Résultat string

generateTree() protected méthode

Recursively generate the tree and return it as HTML string
protected generateTree ( string $table, integer $id, array $arrPrevNext, boolean $blnHasSorting, integer $intMargin, array $arrClipboard = null, boolean $blnCircularReference = false, boolean $protectedPage = false, boolean $blnNoRecursion = false, array $arrFound = [] ) : string
$table string
$id integer
$arrPrevNext array
$blnHasSorting boolean
$intMargin integer
$arrClipboard array
$blnCircularReference boolean
$protectedPage boolean
$blnNoRecursion boolean
$arrFound array
Résultat string

getNewPosition() protected méthode

Calculate the new position of a moved or inserted record
protected getNewPosition ( string $mode, integer $pid = null, boolean $insertInto = false )
$mode string
$pid integer
$insertInto boolean

getPalette() public méthode

Return the name of the current palette
public getPalette ( ) : string
Résultat string

limitMenu() protected méthode

Return a select menu to limit results
protected limitMenu ( boolean $blnOptional = false ) : string
$blnOptional boolean
Résultat string

listView() protected méthode

List all records of the current table and return them as HTML string
protected listView ( ) : string
Résultat string

move() public méthode

Change the order of two neighbour database records
public move ( )

overrideAll() public méthode

Auto-generate a form to override all records that are currently shown
public overrideAll ( ) : string
Résultat string

paginationMenu() protected méthode

Return a pagination menu to browse results
protected paginationMenu ( ) : string
Résultat string

panel() protected méthode

Build the sort panel and return it as string
protected panel ( ) : string
Résultat string

parentView() protected méthode

Show header of the parent table and list all records of the current table
protected parentView ( ) : string
Résultat string

reviseTable() protected méthode

Delete all incomplete and unrelated records
protected reviseTable ( )

save() protected méthode

Save the current value
protected save ( mixed $varValue )
$varValue mixed

searchMenu() protected méthode

Return a search form that allows to search results using regular expressions
protected searchMenu ( ) : string
Résultat string

show() public méthode

Return all non-excluded fields of a record as HTML table
public show ( ) : string
Résultat string

showAll() public méthode

List all records of a particular table
public showAll ( ) : string
Résultat string

sortMenu() protected méthode

Return a select menu that allows to sort results by a particular field
protected sortMenu ( ) : string
Résultat string

treeView() protected méthode

List all records of the current table as tree and return them as HTML string
protected treeView ( ) : string
Résultat string

undo() public méthode

Restore one or more deleted records
public undo ( )

Property Details

$arrModule protected_oe property

The current back end module
protected array $arrModule
Résultat array

$bid protected_oe property

ID of the button container
protected string $bid
Résultat string

$blnCreateNewVersion protected_oe property

True if a new version has to be created
protected bool $blnCreateNewVersion
Résultat boolean

$ctable protected_oe property

Names of the child tables
protected array $ctable
Résultat array

$current protected_oe property

IDs of all records that are currently displayed
protected array $current
Résultat array

$firstOrderBy protected_oe property

First sorting field
protected string $firstOrderBy
Résultat string

$limit protected_oe property

Limit (database query)
protected string $limit
Résultat string

$orderBy protected_oe property

Order by (database query)
protected array $orderBy
Résultat array

$ptable protected_oe property

Name of the parent table
protected string $ptable
Résultat string

$set protected_oe property

Fields of a new or duplicated record
protected array $set
Résultat array

$total protected_oe property

Total (database query)
protected string $total
Résultat string

$treeView protected_oe property

Show the current table as tree
protected bool $treeView
Résultat boolean