/var/www/vhosts/ihelp.ro/_OLD/vendor/cakephp/cakephp/src/Database
Edit: /var/www/vhosts/ihelp.ro/_OLD/vendor/cakephp/cakephp/src/Database/PostgresCompiler.php (2812B)
'DELETE',
'where' => ' WHERE %s',
'group' => ' GROUP BY %s ',
'order' => ' %s',
'limit' => ' LIMIT %s',
'offset' => ' OFFSET %s',
'epilog' => ' %s',
];
/**
* Helper function used to build the string representation of a HAVING clause,
* it constructs the field list taking care of aliasing and
* converting expression objects to string.
*
* @param array $parts list of fields to be transformed to string
* @param \Cake\Database\Query $query The query that is being compiled
* @param \Cake\Database\ValueBinder $generator the placeholder generator to be used in expressions
* @return string
*/
protected function _buildHavingPart($parts, $query, $generator)
{
$selectParts = $query->clause('select');
foreach ($selectParts as $selectKey => $selectPart) {
if (!$selectPart instanceof FunctionExpression) {
continue;
}
foreach ($parts as $k => $p) {
if (!is_string($p)) {
continue;
}
preg_match_all(
'/\b' . trim($selectKey, '"') . '\b/i',
$p,
$matches
);
if (empty($matches[0])) {
continue;
}
$parts[$k] = preg_replace(
['/"/', '/\b' . trim($selectKey, '"') . '\b/i'],
['', $selectPart->sql($generator)],
$p
);
}
}
return sprintf('HAVING %s', implode(', ', $parts));
}
}