function(string $statement)
{
if ($this->_parser === null) {
$this->_parser = new PHPSQLParser();
}
$done = false;
try {
$r = $this->_parser->parse($statement);
$done = 1;
}
catch (\Exception $e){
$this->log('Error while parsing the query '.$statement);
}
if ($done) {
if (!$r || !count($r)) {
$this->log('Impossible to parse the query '.$statement);
return null;
}
if (isset($r['BRACKET']) && (\count($r) === 1)) {
/** @todo Is it impossible to parse queries with brackets ? */
//throw new \Exception('Bracket in the query '.$statement);
return null;
}
return $r;
}
return null;
}