protected function parseParams($expression, $params)
    {
        if (empty($params)) {
            return $expression;
        }

        foreach ($params as $name => $value) {
            if (strncmp($name, ':', 1) !== 0) {
                $name = ':' . $name;
            }
            // unable to use `str_replace()` because particular param name may be a substring of another param name
            $pattern = "/" . preg_quote($name, '/') . '\b/';
            $value = '"' . $this->db->escapeMatchValue($value) . '"';
            $expression = preg_replace($pattern, $value, $expression, -1, $cnt);
        }

        return $expression;
    }
protected function parseParams($expression, $params)
    {
        if (empty($params)) {
            return $expression;
        }

        foreach ($params as $name => $value) {
            if (strncmp($name, ':', 1) !== 0) {
                $name = ':' . $name;
            }
            // unable to use `str_replace()` because particular param name may be a substring of another param name
            $pattern = "/" . preg_quote($name, '/') . '\b/';
            $value = '"' . $this->db->escapeMatchValue($value) . '"';
            $expression = preg_replace($pattern, $value, $expression, -1, $cnt);
        }

        return $expression;
    }
protected function parseParams ( $ expression , $ params ) { if ( empty ( $ params ) ) { return $ expression ; } foreach ( $ params as $ name => $ value ) { if ( strncmp ( $ name , ':' , 1 ) !== 0 ) { $ name = ':' . $ name ; } // unable to use `str_replace()` because particular param name may be a substring of another param name $ pattern = "/" . preg_quote ( $ name , '/' ) . '\b/' ; $ value = '"' . $ this -> db -> escapeMatchValue ( $ value ) . '"' ; $ expression = preg_replace ( $ pattern , $ value , $ expression , - 1 , $ cnt ) ; } return $ expression ; }
Returns the actual MATCH expression by inserting parameter values into the corresponding placeholders.
@param string $expression the expression string which is needed to prepare.
@param array $params the binding parameters for inserting.
@return string parsed expression.
Returns the actual MATCH expression by inserting parameter values into the corresponding placeholders .