本文整理汇总了PHP中DBManager::createTableParams方法的典型用法代码示例。如果您正苦于以下问题:PHP DBManager::createTableParams方法的具体用法?PHP DBManager::createTableParams怎么用?PHP DBManager::createTableParams使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DBManager
的用法示例。
在下文中一共展示了DBManager::createTableParams方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
/**
* If auditing is enabled, create the audit table.
*
* Function is used by the install scripts and a repair utility in the admin panel.
*
* Internal function, do not override.
*/
function create_audit_table()
{
global $dictionary;
$table_name = $this->get_audit_table_name();
require 'metadata/audit_templateMetaData.php';
// Bug: 52583 Need ability to customize template for audit tables
$custom = 'custom/metadata/audit_templateMetaData_' . $this->getTableName() . '.php';
if (file_exists($custom)) {
require $custom;
}
$fieldDefs = $dictionary['audit']['fields'];
$indices = $dictionary['audit']['indices'];
// Renaming template indexes to fit the particular audit table (removed the brittle hard coding)
foreach ($indices as $nr => $properties) {
$indices[$nr]['name'] = 'idx_' . strtolower($this->getTableName()) . '_' . $properties['name'];
}
$engine = null;
if (isset($dictionary['audit']['engine'])) {
$engine = $dictionary['audit']['engine'];
} else {
if (isset($dictionary[$this->getObjectName()]['engine'])) {
$engine = $dictionary[$this->getObjectName()]['engine'];
}
}
$this->db->createTableParams($table_name, $fieldDefs, $indices, $engine);
}
示例2: create_audit_table
/**
* If auditing is enabled, create the audit table.
*
* Function is used by the install scripts and a repair utility in the admin panel.
*/
public final function create_audit_table()
{
global $dictionary;
$table_name = $this->get_audit_table_name();
require DOCROOT . 'metadata/audit_templateMetaData.php';
// Bug: 52583 Need ability to customize template for audit tables
if (file_exists($custom = DOCROOT . 'custom/metadata/audit_templateMetaData_' . $this->getTableName() . '.php')) {
require $custom;
}
$fieldDefs = (array) array_get($dictionary, 'audit.fields');
$indices = (array) array_get($dictionary, 'audit.indices');
// Renaming template indexes to fit the particular audit table (removed the brittle hard coding)
foreach ($indices as $nr => $properties) {
$indices[$nr]['name'] = 'idx_' . strtolower($this->getTableName()) . '_' . $properties['name'];
}
$engine = array_get($dictionary, 'audit.engine', array_get($dictionary, "{$this->getObjectName()}.engine"));
$this->db->createTableParams($table_name, $fieldDefs, $indices, $engine);
}
示例3: createTableParams
protected function createTableParams($tablename, $fieldDefs, $indices)
{
$this->created[$tablename] = true;
return $this->_db->createTableParams($tablename, $fieldDefs, $indices);
}