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