本文整理汇总了PHP中Doctrine\DBAL\Connection::getExpressionBuilder方法的典型用法代码示例。如果您正苦于以下问题:PHP Connection::getExpressionBuilder方法的具体用法?PHP Connection::getExpressionBuilder怎么用?PHP Connection::getExpressionBuilder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Doctrine\DBAL\Connection
的用法示例。
在下文中一共展示了Connection::getExpressionBuilder方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Construtor
*
* @param Connection $connection
* @param array $rootAliases
* @param array $fieldMap
*/
public function __construct(Connection $connection, array $rootAliases, array $fieldMap = array())
{
$this->rootAliases = $rootAliases;
$this->fieldMap = $fieldMap;
$this->conn = $connection;
$this->expr = $this->conn->getExpressionBuilder();
}
示例2: 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->createQueryBuilder()
* ->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 \Doctrine\DBAL\Query\Expression\ExpressionBuilder
*/
public function expr()
{
return $this->connection->getExpressionBuilder();
}
示例3: getExpressionBuilder
/**
* Gets the ExpressionBuilder for the connection.
*
* @return \Doctrine\DBAL\Query\Expression\ExpressionBuilder
* @deprecated please use $this->getQueryBuilder()->expr() instead
*/
public function getExpressionBuilder()
{
$backtrace = $this->getCallerBacktrace();
\OC::$server->getLogger()->debug('Doctrine ExpressionBuilder retrieved in {backtrace}', ['app' => 'core', 'backtrace' => $backtrace]);
return parent::getExpressionBuilder();
}
示例4: expr
/**
* Alias for <code>$this->getDatabase()->getExpressionBuilder()</code>.
*
* @final
*
* @return \Doctrine\DBAL\Query\Expression\ExpressionBuilder
*/
protected final function expr()
{
return $this->db->getExpressionBuilder();
}