本文整理汇总了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());
}