From 778d8dbafd982a018c7425f660f59c7ecaa97d2b Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Mon, 8 Dec 2014 18:00:42 +0100 Subject: Add tableExists to public db api --- lib/private/db/connection.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'lib/private/db') diff --git a/lib/private/db/connection.php b/lib/private/db/connection.php index e2d90c8fc82..9de7a719ff5 100644 --- a/lib/private/db/connection.php +++ b/lib/private/db/connection.php @@ -177,6 +177,18 @@ class Connection extends \Doctrine\DBAL\Connection implements IDBConnection { } } + /** + * Check if a table exists + * + * @param string $table table name without the prefix + * @return bool + */ + public function tableExists($table){ + $table = $this->tablePrefix . trim($table); + $schema = $this->getSchemaManager(); + return $schema->tablesExist(array($table)); + } + // internal use /** * @param string $statement -- cgit v1.2.3