original_string: protected function getOptionsFromArray($scope, $searchQuery = null)
      {
          /*
           * Load the data
           */
          $options = $scope->options;
  
          if (is_scalar($options)) {
              $model = $this->scopeModels[$scope->scopeName];
              $methodName = $options;
  
              if (!$model->methodExists($methodName)) {
                  throw new ApplicationException(Lang::get('backend::lang.filter.options_method_not_exists', [
                      'model'  => get_class($model),
                      'method' => $methodName,
                      'filter' => $scope->scopeName
                  ]));
              }
  
              $options = $model->$methodName();
          }
          elseif (!is_array($options)) {
              $options = [];
          }
  
          /*
           * Apply the search
           */
          $searchQuery = Str::lower($searchQuery);
          if (strlen($searchQuery)) {
              $options = $this->filterOptionsBySearch($options, $searchQuery);
          }
  
          return $options;
      }
code: protected function getOptionsFromArray($scope, $searchQuery = null)
      {
          /*
           * Load the data
           */
          $options = $scope->options;
  
          if (is_scalar($options)) {
              $model = $this->scopeModels[$scope->scopeName];
              $methodName = $options;
  
              if (!$model->methodExists($methodName)) {
                  throw new ApplicationException(Lang::get('backend::lang.filter.options_method_not_exists', [
                      'model'  => get_class($model),
                      'method' => $methodName,
                      'filter' => $scope->scopeName
                  ]));
              }
  
              $options = $model->$methodName();
          }
          elseif (!is_array($options)) {
              $options = [];
          }
  
          /*
           * Apply the search
           */
          $searchQuery = Str::lower($searchQuery);
          if (strlen($searchQuery)) {
              $options = $this->filterOptionsBySearch($options, $searchQuery);
          }
  
          return $options;
      }
code_tokens: protected function getOptionsFromArray ( $ scope , $ searchQuery = null ) { /*
           * Load the data
           */ $ options = $ scope -> options ; if ( is_scalar ( $ options ) ) { $ model = $ this -> scopeModels [ $ scope -> scopeName ] ; $ methodName = $ options ; if ( ! $ model -> methodExists ( $ methodName ) ) { throw new ApplicationException ( Lang :: get ( 'backend::lang.filter.options_method_not_exists' , [ 'model' => get_class ( $ model ) , 'method' => $ methodName , 'filter' => $ scope -> scopeName ] ) ) ; } $ options = $ model -> $ methodName ( ) ; } elseif ( ! is_array ( $ options ) ) { $ options = [ ] ; } /*
           * Apply the search
           */ $ searchQuery = Str :: lower ( $ searchQuery ) ; if ( strlen ( $ searchQuery ) ) { $ options = $ this -> filterOptionsBySearch ( $ options , $ searchQuery ) ; } return $ options ; }
docstring: Look at the defined set of options for scope items, or the model method.
  @return array
docstring_tokens: Look at the defined set of options for scope items or the model method .