original_string: public function filter(Model $model, $key = null)
      {
          if (is_null($this->filter)) {
              $this->filter = Filter::fromSchema($this->schema());
          }
  
          $this->applyHook('filtering', $model, $key);
          $result = $this->filter->run($model, $key);
          $this->applyHook('filtered', $model, $key);
  
          return $result;
      }
code: public function filter(Model $model, $key = null)
      {
          if (is_null($this->filter)) {
              $this->filter = Filter::fromSchema($this->schema());
          }
  
          $this->applyHook('filtering', $model, $key);
          $result = $this->filter->run($model, $key);
          $this->applyHook('filtered', $model, $key);
  
          return $result;
      }
code_tokens: public function filter ( Model $ model , $ key = null ) { if ( is_null ( $ this -> filter ) ) { $ this -> filter = Filter :: fromSchema ( $ this -> schema ( ) ) ; } $ this -> applyHook ( 'filtering' , $ model , $ key ) ; $ result = $ this -> filter -> run ( $ model , $ key ) ; $ this -> applyHook ( 'filtered' , $ model , $ key ) ; return $ result ; }
docstring: Filter model data with functions to cleanse, prepare and validate data. When key argument specified, filter will run partially for specified key only.
  
  @param \Norm\Model   $model
  
  @param string $key Key field of model
  
  @return bool True if success and false if fail
docstring_tokens: Filter model data with functions to cleanse prepare and validate data . When key argument specified filter will run partially for specified key only .