public function expr(Model $m, $expr, $args = [])
{
preg_replace_callback('/\\[[a-z0-9_]*\\]|{[a-z0-9_]*}/', function ($matches) use(&$args, $m) {
$identifier = substr($matches[0], 1, -1);
if ($identifier && !isset($args[$identifier])) {
$args[$identifier] = $m->getElement($identifier);
}
return $matches[0];
}, $expr);
return $this->connection->expr($expr, $args);
}