本文整理汇总了PHP中Vtiger_Utils::CreateTableSql方法的典型用法代码示例。如果您正苦于以下问题:PHP Vtiger_Utils::CreateTableSql方法的具体用法?PHP Vtiger_Utils::CreateTableSql怎么用?PHP Vtiger_Utils::CreateTableSql使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vtiger_Utils
的用法示例。
在下文中一共展示了Vtiger_Utils::CreateTableSql方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: export_Tables
/**
* Export module base and related tables
* @access private
*/
function export_Tables($moduleInstance)
{
$_exportedTables = array();
$modulename = $moduleInstance->name;
$this->openNode('tables');
if ($moduleInstance->isentitytype) {
$focus = CRMEntity::getInstance($modulename);
// Setup required module variables which is need for vtlib API's
vtlib_setup_modulevars($modulename, $focus);
$tables = array($focus->table_name);
if (!empty($focus->groupTable)) {
$tables[] = $focus->groupTable[0];
}
if (!empty($focus->customFieldTable)) {
$tables[] = $focus->customFieldTable[0];
}
foreach ($tables as $table) {
$this->openNode('table');
$this->outputNode($table, 'name');
$this->outputNode('<![CDATA[' . Vtiger_Utils::CreateTableSql($table) . ']]>', 'sql');
$this->closeNode('table');
$_exportedTables[] = $table;
}
}
// Now export table information recorded in schema file
if (file_exists("modules/{$modulename}/schema.xml")) {
$schema = simplexml_load_file("modules/{$modulename}/schema.xml");
if (!empty($schema->tables) && !empty($schema->tables->table)) {
foreach ($schema->tables->table as $tablenode) {
$table = trim($tablenode->name);
if (!in_array($table, $_exportedTables)) {
$this->openNode('table');
$this->outputNode($table, 'name');
$this->outputNode('<![CDATA[' . Vtiger_Utils::CreateTableSql($table) . ']]>', 'sql');
$this->closeNode('table');
$_exportedTables[] = $table;
}
}
}
}
$this->closeNode('tables');
}