original_string: public function sort($by, $direction = "asc", $override = false) {
          $this->assertInitiated("sort");
          if ($override) {
              $this->query['sort'] = [];
          }
          $this->query['sort'][] = [$by => $direction];
          return $this;
      }
code: public function sort($by, $direction = "asc", $override = false) {
          $this->assertInitiated("sort");
          if ($override) {
              $this->query['sort'] = [];
          }
          $this->query['sort'][] = [$by => $direction];
          return $this;
      }
code_tokens: public function sort ( $ by , $ direction = "asc" , $ override = false ) { $ this -> assertInitiated ( "sort" ) ; if ( $ override ) { $ this -> query [ 'sort' ] = [ ] ; } $ this -> query [ 'sort' ] [ ] = [ $ by => $ direction ] ; return $ this ; }
docstring: Adds a sort clause to the query
  
  @param string $by the key to sort by it
  @param string|array $direction the direction of the sort.
  Can be an array for extra sort control.
  @param boolean $override false by default. if true it will reset the sort
  first, then add the new sort entry.
  @return QueryBuilder|static|self
docstring_tokens: Adds a sort clause to the query