original_string: public function filter($filter)
      {
          if (is_array($filter)) {
              $filter = new GridFilter($filter);
          }
  
          if ($filter instanceof FilterSpecification) {
              $filter = new GridFilter($filter->asFilter());
          }
  
          $this->filter = $filter;
  
          return $this;
      }
code: public function filter($filter)
      {
          if (is_array($filter)) {
              $filter = new GridFilter($filter);
          }
  
          if ($filter instanceof FilterSpecification) {
              $filter = new GridFilter($filter->asFilter());
          }
  
          $this->filter = $filter;
  
          return $this;
      }
code_tokens: public function filter ( $ filter ) { if ( is_array ( $ filter ) ) { $ filter = new GridFilter ( $ filter ) ; } if ( $ filter instanceof FilterSpecification ) { $ filter = new GridFilter ( $ filter -> asFilter ( ) ) ; } $ this -> filter = $ filter ; return $ this ; }
docstring: Set filter to the resource selecting
  
  @param array|FilterSpecification|GridFilter $filter
  
  @return $this
docstring_tokens: Set filter to the resource selecting