當前位置: 首頁>>代碼示例>>PHP>>正文


PHP IDBConnection::getDatabasePlatform方法代碼示例

本文整理匯總了PHP中OCP\IDBConnection::getDatabasePlatform方法的典型用法代碼示例。如果您正苦於以下問題:PHP IDBConnection::getDatabasePlatform方法的具體用法?PHP IDBConnection::getDatabasePlatform怎麽用?PHP IDBConnection::getDatabasePlatform使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在OCP\IDBConnection的用法示例。


在下文中一共展示了IDBConnection::getDatabasePlatform方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: assertTableNotExist

	/**
	 * @param string $table
	 */
	public function assertTableNotExist($table) {
		if ($this->connection->getDatabasePlatform() instanceof SqlitePlatform) {
			// sqlite removes the tables after closing the DB
			$this->assertTrue(true);
		} else {
			$this->assertFalse($this->connection->tableExists($table), 'Table ' . $table . ' doesnt exists.');
		}
	}
開發者ID:ninjasilicon,項目名稱:core,代碼行數:11,代碼來源:connection.php

示例2: fixUserRootPermissions

 /**
  * Make sure all user roots have permissions 23 (all but share)
  */
 protected function fixUserRootPermissions()
 {
     $qb = $this->connection->getQueryBuilder();
     $qb2 = $this->connection->getQueryBuilder();
     $qb->select('numeric_id')->from('storages')->where($qb->expr()->like('id', $qb2->createParameter('like')));
     if ($this->connection->getDatabasePlatform() instanceof OraclePlatform) {
         // '' is null on oracle
         $path = $qb2->expr()->isNull('path');
     } else {
         $path = $qb2->expr()->eq('path', $qb2->createNamedParameter(''));
     }
     $qb2->update('filecache')->set('permissions', $qb2->createNamedParameter(23))->where($path)->andWhere($qb2->expr()->in('storage', $qb2->createFunction($qb->getSQL())))->andWhere($qb2->expr()->neq('permissions', $qb2->createNamedParameter(23)))->setParameter('like', 'home::%');
     $qb2->execute();
 }
開發者ID:rchicoli,項目名稱:owncloud-core,代碼行數:17,代碼來源:AvatarPermissions.php

示例3: expr

 /**
  * Gets an ExpressionBuilder used for object-oriented construction of query expressions.
  * This producer method is intended for convenient inline usage. Example:
  *
  * <code>
  *     $qb = $conn->getQueryBuilder()
  *         ->select('u')
  *         ->from('users', 'u')
  *         ->where($qb->expr()->eq('u.id', 1));
  * </code>
  *
  * For more complex expression construction, consider storing the expression
  * builder object in a local variable.
  *
  * @return \OCP\DB\QueryBuilder\IExpressionBuilder
  */
 public function expr()
 {
     if ($this->connection instanceof OracleConnection) {
         return new OCIExpressionBuilder($this->connection);
     } else {
         if ($this->connection->getDatabasePlatform() instanceof PostgreSqlPlatform) {
             return new PgSqlExpressionBuilder($this->connection);
         } else {
             return new ExpressionBuilder($this->connection);
         }
     }
 }
開發者ID:farukuzun,項目名稱:core-1,代碼行數:28,代碼來源:querybuilder.php

示例4: clear

 /**
  * Truncate's the mapping table
  * @return bool
  */
 public function clear()
 {
     $sql = $this->dbc->getDatabasePlatform()->getTruncateTableSQL('`' . $this->getTableName() . '`');
     return $this->dbc->prepare($sql)->execute();
 }
開發者ID:rchicoli,項目名稱:owncloud-core,代碼行數:9,代碼來源:AbstractMapping.php

示例5: getDatabasePlatform

 /**
  * Gets the DatabasePlatform instance that provides all the metadata about
  * the platform this driver connects to.
  *
  * @return \Doctrine\DBAL\Platforms\AbstractPlatform The database platform.
  */
 public function getDatabasePlatform()
 {
     return $this->connection->getDatabasePlatform();
 }
開發者ID:farukuzun,項目名稱:core-1,代碼行數:10,代碼來源:db.php


注:本文中的OCP\IDBConnection::getDatabasePlatform方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。