original_string: protected function getCriteria(Builder $builder, array $query)
      {
          $criteria = [];
          foreach ($query as $value) {
              $criterion = Criterion::make($value, $this->_getDefaultSortOrder());
              if ($this->isFieldSortable($builder, $criterion->getField())) {
                  $criteria[] = $criterion;
              }
          }
  
          return $criteria;
      }
code: protected function getCriteria(Builder $builder, array $query)
      {
          $criteria = [];
          foreach ($query as $value) {
              $criterion = Criterion::make($value, $this->_getDefaultSortOrder());
              if ($this->isFieldSortable($builder, $criterion->getField())) {
                  $criteria[] = $criterion;
              }
          }
  
          return $criteria;
      }
code_tokens: protected function getCriteria ( Builder $ builder , array $ query ) { $ criteria = [ ] ; foreach ( $ query as $ value ) { $ criterion = Criterion :: make ( $ value , $ this -> _getDefaultSortOrder ( ) ) ; if ( $ this -> isFieldSortable ( $ builder , $ criterion -> getField ( ) ) ) { $ criteria [ ] = $ criterion ; } } return $ criteria ; }
docstring: Builds sort criteria based on model's sortable fields and query parameters.
  
  @param Builder $builder query builder
  @param array $query query parameters
  
  @return array
docstring_tokens: Builds sort criteria based on model s sortable fields and query parameters .