本文整理匯總了PHP中DataTables\Editor::table方法的典型用法代碼示例。如果您正苦於以下問題:PHP Editor::table方法的具體用法?PHP Editor::table怎麽用?PHP Editor::table使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DataTables\Editor
的用法示例。
在下文中一共展示了Editor::table方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: _prep
/**
* Prepare the instance to be run.
*
* @param Editor $editor Editor instance
* @private
*/
private function _prep($editor)
{
$links = $this->_links;
// Were links used to configure this instance - if so, we need to
// back them onto the join array
if ($this->_join['parent'] === null && count($links)) {
$editorTable = $editor->table();
$editorTable = $editorTable[0];
$joinTable = $this->table();
if ($this->_aliasParentTable) {
$editorTable = $this->_aliasParentTable;
}
if (count($links) === 2) {
// No link table
$f1 = explode('.', $links[0]);
$f2 = explode('.', $links[1]);
$this->_join['parent'] = $f1[1];
$this->_join['child'] = $f2[1];
} else {
// Link table
$f1 = explode('.', $links[0]);
$f2 = explode('.', $links[1]);
$f3 = explode('.', $links[2]);
$f4 = explode('.', $links[3]);
// Discover the name of the link table
if ($f1[0] !== $editorTable && $f1[0] !== $joinTable) {
$this->_join['table'] = $f1[0];
} else {
if ($f2[0] !== $editorTable && $f2[0] !== $joinTable) {
$this->_join['table'] = $f2[0];
} else {
if ($f3[0] !== $editorTable && $f3[0] !== $joinTable) {
$this->_join['table'] = $f3[0];
} else {
$this->_join['table'] = $f2[0];
}
}
}
$this->_join['parent'] = array($f1[1], $f2[1]);
$this->_join['child'] = array($f3[1], $f4[1]);
}
}
}
示例2: dbCleanExec
/**
* Clean the database
* @param \DataTables\Editor $editor Calling Editor instance
* @param Field $field Host field
* @internal
*/
public function dbCleanExec($editor, $field)
{
// Database and file system clean up BEFORE adding the new file to
// the db, otherwise it will be removed immediately
$tables = $editor->table();
$this->_dbClean($editor->db(), $tables[0], $field->dbField());
}