本文整理汇总了PHP中OCP\IDBConnection::dropTable方法的典型用法代码示例。如果您正苦于以下问题:PHP IDBConnection::dropTable方法的具体用法?PHP IDBConnection::dropTable怎么用?PHP IDBConnection::dropTable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OCP\IDBConnection
的用法示例。
在下文中一共展示了IDBConnection::dropTable方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
/**
* Run repair step.
* Must throw exception on error.
*
* @throws \Exception in case of failure
*/
public function run()
{
foreach ($this->oldDatabaseTables() as $tableName) {
if ($this->connection->tableExists($tableName)) {
$this->emit('\\OC\\Repair', 'info', [sprintf('Table %s has been deleted', $tableName)]);
$this->connection->dropTable($tableName);
}
}
}
示例2: run
/**
* Run repair step.
* Must throw exception on error.
*
* @throws \Exception in case of failure
*/
public function run(IOutput $output)
{
$tables = $this->oldDatabaseTables();
$output->startProgress(count($tables));
foreach ($this->oldDatabaseTables() as $tableName) {
if ($this->connection->tableExists($tableName)) {
$this->connection->dropTable($tableName);
}
$output->advance(1, "Drop old database table: {$tableName}");
}
$output->finishProgress();
}
示例3: testDropTable
/**
* @depends testTableExists
*/
public function testDropTable()
{
$this->makeTestTable();
$this->assertTableExist('table');
$this->connection->dropTable('table');
$this->assertTableNotExist('table');
}
示例4: testSetValuesOverWritePrecondition
public function testSetValuesOverWritePrecondition()
{
$this->makeTestTable();
$this->connection->setValues('table', ['integerfield' => 1], ['textfield' => 'foo', 'booleanfield' => true, 'clobfield' => 'not_null']);
$this->connection->setValues('table', ['integerfield' => 1], ['textfield' => 'bar'], ['booleanfield' => true]);
$this->assertEquals('bar', $this->getTextValueByIntergerField(1));
$this->connection->dropTable('table');
}
示例5: dropTable
/**
* Drop a table from the database if it exists
*
* @param string $table table name without the prefix
*/
public function dropTable($table)
{
$this->connection->dropTable($table);
}
示例6: tearDown
public function tearDown()
{
$this->db->dropTable('contacts_addressbooks');
$this->db->dropTable('contacts_cards');
parent::tearDown();
}