本文整理汇总了PHP中DatabaseCompatibilityUtil::getAllTableNames方法的典型用法代码示例。如果您正苦于以下问题:PHP DatabaseCompatibilityUtil::getAllTableNames方法的具体用法?PHP DatabaseCompatibilityUtil::getAllTableNames怎么用?PHP DatabaseCompatibilityUtil::getAllTableNames使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DatabaseCompatibilityUtil
的用法示例。
在下文中一共展示了DatabaseCompatibilityUtil::getAllTableNames方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: deleteRowsFromAllTablesExceptLog
public static function deleteRowsFromAllTablesExceptLog()
{
assert('RedBeanDatabase::isSetup()');
$tableNames = DatabaseCompatibilityUtil::getAllTableNames();
foreach ($tableNames as $tableName) {
if ($tableName != 'log') {
R::exec("delete from {$tableName}");
}
}
}
示例2: deleteAllTablesOrRowsExceptLog
protected static function deleteAllTablesOrRowsExceptLog($deleteTables)
{
assert('RedBeanDatabase::isSetup()');
$tableNames = DatabaseCompatibilityUtil::getAllTableNames();
if (($logTableNameKey = array_search('log', $tableNames)) !== false) {
unset($tableNames[$logTableNameKey]);
}
foreach ($tableNames as $tableName) {
if ($deleteTables) {
ZurmoRedBean::$writer->dropTableByTableName($tableName);
} else {
ZurmoRedBean::$writer->wipe($tableName);
}
}
}
示例3: testGetAllTableNames
public function testGetAllTableNames()
{
R::exec("create table temptable (temptable_id int(11) unsigned not null)");
$tables = DatabaseCompatibilityUtil::getAllTableNames();
$this->assertTrue(in_array('temptable', $tables));
}