本文整理汇总了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.');
}
}
示例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();
}
示例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);
}
}
}
示例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();
}
示例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();
}