original_string: protected function getAvailableOptions($scope, $searchQuery = null)
      {
          if ($scope->options) {
              return $this->getOptionsFromArray($scope, $searchQuery);
          }
  
          $available = [];
          $nameColumn = $this->getScopeNameFrom($scope);
          $options = $this->getOptionsFromModel($scope, $searchQuery);
          foreach ($options as $option) {
              $available[$option->getKey()] = $option->{$nameColumn};
          }
  
          return $available;
      }
code: protected function getAvailableOptions($scope, $searchQuery = null)
      {
          if ($scope->options) {
              return $this->getOptionsFromArray($scope, $searchQuery);
          }
  
          $available = [];
          $nameColumn = $this->getScopeNameFrom($scope);
          $options = $this->getOptionsFromModel($scope, $searchQuery);
          foreach ($options as $option) {
              $available[$option->getKey()] = $option->{$nameColumn};
          }
  
          return $available;
      }
code_tokens: protected function getAvailableOptions ( $ scope , $ searchQuery = null ) { if ( $ scope -> options ) { return $ this -> getOptionsFromArray ( $ scope , $ searchQuery ) ; } $ available = [ ] ; $ nameColumn = $ this -> getScopeNameFrom ( $ scope ) ; $ options = $ this -> getOptionsFromModel ( $ scope , $ searchQuery ) ; foreach ( $ options as $ option ) { $ available [ $ option -> getKey ( ) ] = $ option -> { $ nameColumn } ; } return $ available ; }
docstring: Returns the available options a scope can use, either from the
  model relation or from a supplied array. Optionally apply a search
  constraint to the options.
  @param  string $scope
  @param  string $searchQuery
  @return array
docstring_tokens: Returns the available options a scope can use either from the model relation or from a supplied array . Optionally apply a search constraint to the options .