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