本文整理汇总了PHP中Illuminate\Database\Query\Builder::getGrammar方法的典型用法代码示例。如果您正苦于以下问题:PHP Builder::getGrammar方法的具体用法?PHP Builder::getGrammar怎么用?PHP Builder::getGrammar使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Database\Query\Builder
的用法示例。
在下文中一共展示了Builder::getGrammar方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Create a new join clause instance.
*
* @param \Illuminate\Database\Query\Builder $parentQuery
* @param string $type
* @param string $table
* @return void
*/
public function __construct(Builder $parentQuery, $type, $table)
{
$this->type = $type;
$this->table = $table;
$this->parentQuery = $parentQuery;
parent::__construct($parentQuery->getConnection(), $parentQuery->getGrammar(), $parentQuery->getProcessor());
}
示例2: __construct
public function __construct(Builder $builder, Request $request)
{
$this->query = $builder;
$this->request = $request;
$this->columns = $this->query->columns;
$this->prefix = $this->query->getGrammar()->getTablePrefix();
}
示例3: getValue
/**
* Evaluate query as string.
*
* @return string
*/
public function getValue()
{
$sql = '(' . $this->query->toSql() . ')';
if ($this->alias) {
$alias = $this->query->getGrammar()->wrapTable($this->alias);
$sql .= ' as ' . $alias;
}
return $sql;
}
示例4: getLikeOperator
/**
* Get driver-specific case insensitive like operator.
*
* @return string
*/
protected function getLikeOperator()
{
$grammar = $this->query->getGrammar();
if ($grammar instanceof PostgresGrammar) {
return 'ilike';
}
return 'like';
}
示例5: getGrammar
/**
* Get the query grammar instance.
*
* @return \Illuminate\Database\Query\Grammars\Grammar
* @static
*/
public static function getGrammar()
{
return \Illuminate\Database\Query\Builder::getGrammar();
}
示例6: getILike
/**
* @param Builder|QueryBuilder $queryBuilder
* @return string
*/
protected function getILike($queryBuilder)
{
$grammar = $queryBuilder->getGrammar();
if ($grammar instanceof MySqlGrammar) {
return "COLLATE UTF8_GENERAL_CI LIKE";
}
if ($grammar instanceof PostgresGrammar) {
return "ilike";
}
return 'like';
}