original_string: public function onFilterGetOptions()
      {
          $this->defineFilterScopes();
  
          $searchQuery = post('search');
          if (!$scopeName = post('scopeName')) {
              return;
          }
  
          $scope = $this->getScope($scopeName);
          $activeKeys = $scope->value ? array_keys($scope->value) : [];
          $available = $this->getAvailableOptions($scope, $searchQuery);
          $active = $searchQuery ? [] : $this->filterActiveOptions($activeKeys, $available);
  
          return [
              'scopeName' => $scopeName,
              'options' => [
                  'available' => $this->optionsToAjax($available),
                  'active'    => $this->optionsToAjax($active),
              ]
          ];
      }
code: public function onFilterGetOptions()
      {
          $this->defineFilterScopes();
  
          $searchQuery = post('search');
          if (!$scopeName = post('scopeName')) {
              return;
          }
  
          $scope = $this->getScope($scopeName);
          $activeKeys = $scope->value ? array_keys($scope->value) : [];
          $available = $this->getAvailableOptions($scope, $searchQuery);
          $active = $searchQuery ? [] : $this->filterActiveOptions($activeKeys, $available);
  
          return [
              'scopeName' => $scopeName,
              'options' => [
                  'available' => $this->optionsToAjax($available),
                  'active'    => $this->optionsToAjax($active),
              ]
          ];
      }
code_tokens: public function onFilterGetOptions ( ) { $ this -> defineFilterScopes ( ) ; $ searchQuery = post ( 'search' ) ; if ( ! $ scopeName = post ( 'scopeName' ) ) { return ; } $ scope = $ this -> getScope ( $ scopeName ) ; $ activeKeys = $ scope -> value ? array_keys ( $ scope -> value ) : [ ] ; $ available = $ this -> getAvailableOptions ( $ scope , $ searchQuery ) ; $ active = $ searchQuery ? [ ] : $ this -> filterActiveOptions ( $ activeKeys , $ available ) ; return [ 'scopeName' => $ scopeName , 'options' => [ 'available' => $ this -> optionsToAjax ( $ available ) , 'active' => $ this -> optionsToAjax ( $ active ) , ] ] ; }
docstring: Returns available options for group scope type.
  @return array
docstring_tokens: Returns available options for group scope type .