public function getHash()
    {
        $hash = array();

        // expression
        $hash[] = json_encode($this->expression->toArray());

        // sorts
        if (!empty($this->sort)) {
            $sort = $this->sort;
            ksort($sort);
            $hash[] = implode('', array_merge(array_keys($sort), array_values($sort)));
        }

        // fields
        if (!empty($this->projection)) {
            $fields = $this->projection;
            ksort($fields);
            $hash[] = implode('', array_merge(array_keys($fields), array_values($fields)));
        }

        // skip and limit
        $hash[] = $this->skip;
        $hash[] = $this->limit;

        // get hash
        return md5(implode(':', $hash));
    }
public function getHash()
    {
        $hash = array();

        // expression
        $hash[] = json_encode($this->expression->toArray());

        // sorts
        if (!empty($this->sort)) {
            $sort = $this->sort;
            ksort($sort);
            $hash[] = implode('', array_merge(array_keys($sort), array_values($sort)));
        }

        // fields
        if (!empty($this->projection)) {
            $fields = $this->projection;
            ksort($fields);
            $hash[] = implode('', array_merge(array_keys($fields), array_values($fields)));
        }

        // skip and limit
        $hash[] = $this->skip;
        $hash[] = $this->limit;

        // get hash
        return md5(implode(':', $hash));
    }
public function getHash ( ) { $ hash = array ( ) ; // expression $ hash [ ] = json_encode ( $ this -> expression -> toArray ( ) ) ; // sorts if ( ! empty ( $ this -> sort ) ) { $ sort = $ this -> sort ; ksort ( $ sort ) ; $ hash [ ] = implode ( '' , array_merge ( array_keys ( $ sort ) , array_values ( $ sort ) ) ) ; } // fields if ( ! empty ( $ this -> projection ) ) { $ fields = $ this -> projection ; ksort ( $ fields ) ; $ hash [ ] = implode ( '' , array_merge ( array_keys ( $ fields ) , array_values ( $ fields ) ) ) ; } // skip and limit $ hash [ ] = $ this -> skip ; $ hash [ ] = $ this -> limit ; // get hash return md5 ( implode ( ':' , $ hash ) ) ; }
Used to get hash that uniquely identifies current query

@return string
Used to get hash that uniquely identifies current query