original_string: public function sortingLink()
      {
          $filterlist = '';
  
          if ($this->getParameter('filter') != null) {
              foreach ($this->getParameter('filter') as $get => $value) {
                  $filterlist .= 'filter['.$get.'][]='.$value.'&';
              }
          }
          if ($this->getParameter('sort') != null) {
              $sort = $this->getParameter('sort');
          } else {
              $sort = array();
          }
          if (!empty($sort[$this->getParameter('field')])) {
              if ($sort[$this->getParameter('field')] == 'ASC') {
                  return $filterlist.'sort['.$this->getParameter('field').']=DESC';
              } else {
                  return $filterlist.'sort['.$this->getParameter('field').']=ASC';
              }
          }
          return $filterlist.'sort['.$this->getParameter('field').']='.$this->getParameter('order');
      }
code: public function sortingLink()
      {
          $filterlist = '';
  
          if ($this->getParameter('filter') != null) {
              foreach ($this->getParameter('filter') as $get => $value) {
                  $filterlist .= 'filter['.$get.'][]='.$value.'&';
              }
          }
          if ($this->getParameter('sort') != null) {
              $sort = $this->getParameter('sort');
          } else {
              $sort = array();
          }
          if (!empty($sort[$this->getParameter('field')])) {
              if ($sort[$this->getParameter('field')] == 'ASC') {
                  return $filterlist.'sort['.$this->getParameter('field').']=DESC';
              } else {
                  return $filterlist.'sort['.$this->getParameter('field').']=ASC';
              }
          }
          return $filterlist.'sort['.$this->getParameter('field').']='.$this->getParameter('order');
      }
code_tokens: public function sortingLink ( ) { $ filterlist = '' ; if ( $ this -> getParameter ( 'filter' ) != null ) { foreach ( $ this -> getParameter ( 'filter' ) as $ get => $ value ) { $ filterlist .= 'filter[' . $ get . '][]=' . $ value . '&' ; } } if ( $ this -> getParameter ( 'sort' ) != null ) { $ sort = $ this -> getParameter ( 'sort' ) ; } else { $ sort = array ( ) ; } if ( ! empty ( $ sort [ $ this -> getParameter ( 'field' ) ] ) ) { if ( $ sort [ $ this -> getParameter ( 'field' ) ] == 'ASC' ) { return $ filterlist . 'sort[' . $ this -> getParameter ( 'field' ) . ']=DESC' ; } else { return $ filterlist . 'sort[' . $ this -> getParameter ( 'field' ) . ']=ASC' ; } } return $ filterlist . 'sort[' . $ this -> getParameter ( 'field' ) . ']=' . $ this -> getParameter ( 'order' ) ; }
docstring: Returns a URL with sort parameters
  
  Expected Params:
  filter  string  the string to operate upon
  sort  integer (optional) the starting point for our substring, default 0
  field integer (optional) the length of the substring. default 1
  order integer (optional) the length of the substring. default 1
  
  @return string
docstring_tokens: Returns a URL with sort parameters