original_string: public function setOrderBy($field, $direction = null)
      {
          if (empty($field))
              return $this;
  
          if (count($order = explode(' ', $field)) == 2) {
              $field = $order[0];
              $direction = $order[1];
          }
          $this->orderBy[$field] = empty($direction) ? 'ASC' : $direction;
          return $this;
      }
code: public function setOrderBy($field, $direction = null)
      {
          if (empty($field))
              return $this;
  
          if (count($order = explode(' ', $field)) == 2) {
              $field = $order[0];
              $direction = $order[1];
          }
          $this->orderBy[$field] = empty($direction) ? 'ASC' : $direction;
          return $this;
      }
code_tokens: public function setOrderBy ( $ field , $ direction = null ) { if ( empty ( $ field ) ) return $ this ; if ( count ( $ order = explode ( ' ' , $ field ) ) == 2 ) { $ field = $ order [ 0 ] ; $ direction = $ order [ 1 ] ; } $ this -> orderBy [ $ field ] = empty ( $ direction ) ? 'ASC' : $ direction ; return $ this ; }
docstring: Sets the specified orderBy
  
  @param string $field     The name of the field
  @param string $direction The direction to sort. Can be ASC or DESC (default to ASC if not specified)
  
  @return DTO $this
docstring_tokens: Sets the specified orderBy