/** * @param Grammar $grammar * @return array */ public function build(Grammar $grammar) { $grammar->setQuery($this); $queryStr = $grammar->build(); $queryParams = isset($this->attributes['params']) && !empty($this->attributes['params']) ? $this->attributes['params'] : $grammar->getParams(); return [$queryStr, $queryParams]; }