protected function _sqlCompiler(&$sql, $query, $generator)
    {
        return function ($parts, $name) use (&$sql, $query, $generator) {
            if (!isset($parts) ||
                ((is_array($parts) || $parts instanceof \Countable) && !count($parts))
            ) {
                return;
            }
            if ($parts instanceof ExpressionInterface) {
                $parts = [$parts->sql($generator)];
            }
            if (isset($this->_templates[$name])) {
                $parts = $this->_stringifyExpressions((array)$parts, $generator);

                return $sql .= sprintf($this->_templates[$name], implode(', ', $parts));
            }

            return $sql .= $this->{'_build' . ucfirst($name) . 'Part'}($parts, $query, $generator);
        };
    }
protected function _sqlCompiler(&$sql, $query, $generator)
    {
        return function ($parts, $name) use (&$sql, $query, $generator) {
            if (!isset($parts) ||
                ((is_array($parts) || $parts instanceof \Countable) && !count($parts))
            ) {
                return;
            }
            if ($parts instanceof ExpressionInterface) {
                $parts = [$parts->sql($generator)];
            }
            if (isset($this->_templates[$name])) {
                $parts = $this->_stringifyExpressions((array)$parts, $generator);

                return $sql .= sprintf($this->_templates[$name], implode(', ', $parts));
            }

            return $sql .= $this->{'_build' . ucfirst($name) . 'Part'}($parts, $query, $generator);
        };
    }
protected function _sqlCompiler ( & $ sql , $ query , $ generator ) { return function ( $ parts , $ name ) use ( & $ sql , $ query , $ generator ) { if ( ! isset ( $ parts ) || ( ( is_array ( $ parts ) || $ parts instanceof \ Countable ) && ! count ( $ parts ) ) ) { return ; } if ( $ parts instanceof ExpressionInterface ) { $ parts = [ $ parts -> sql ( $ generator ) ] ; } if ( isset ( $ this -> _templates [ $ name ] ) ) { $ parts = $ this -> _stringifyExpressions ( ( array ) $ parts , $ generator ) ; return $ sql .= sprintf ( $ this -> _templates [ $ name ] , implode ( ', ' , $ parts ) ) ; } return $ sql .= $ this -> { '_build' . ucfirst ( $ name ) . 'Part' } ( $ parts , $ query , $ generator ) ; } ; }
Returns a callable object that can be used to compile a SQL string representation
of this query.

@param string $sql initial sql string to append to
@param \Cake\Database\Query $query The query that is being compiled
@param \Cake\Database\ValueBinder $generator The placeholder and value binder object
@return \Closure
Returns a callable object that can be used to compile a SQL string representation of this query .