当前位置: 首页>>代码示例>>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;未经允许,请勿转载。