本文整理匯總了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();
}