getInner()->getParams(); $this->collation = $params['collation'] ?? (($params['charset'] ?? 'utf8') . '_general_ci'); } /** * @inheritdoc */ public function iLike($x, $y, $type = null): string { $x = $this->helper->quoteColumnName($x); $y = $this->helper->quoteColumnName($y); return $this->expressionBuilder->comparison($x, ' COLLATE ' . $this->collation . ' LIKE', $y); } /** * Returns a IQueryFunction that casts the column to the given type * * @param string|IQueryFunction $column * @param mixed $type One of IQueryBuilder::PARAM_* * @psalm-param IQueryBuilder::PARAM_* $type * @return IQueryFunction */ public function castColumn($column, $type): IQueryFunction { switch ($type) { case IQueryBuilder::PARAM_STR: return new QueryFunction('CAST(' . $this->helper->quoteColumnName($column) . ' AS CHAR)'); default: return parent::castColumn($column, $type); } } }