diff options
author | Robin Appelman <icewind@owncloud.com> | 2014-12-08 18:00:42 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2014-12-09 17:26:53 +0100 |
commit | 778d8dbafd982a018c7425f660f59c7ecaa97d2b (patch) | |
tree | 725d73330483bc04ceb1c4032b0a440cb1e7d3c6 /lib/private/db | |
parent | 8af3991d0cf129316b177731686af547fe39a698 (diff) | |
download | nextcloud-server-778d8dbafd982a018c7425f660f59c7ecaa97d2b.tar.gz nextcloud-server-778d8dbafd982a018c7425f660f59c7ecaa97d2b.zip |
Add tableExists to public db api
Diffstat (limited to 'lib/private/db')
-rw-r--r-- | lib/private/db/connection.php | 12 |
1 files changed, 12 insertions, 0 deletions
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 |