You are here

class DenormalizedEntityIndexHijack in Search API Grouping 7.2

Class to hijack the protected method getProcessors().

As this class extends SearchApiIndex it can access protected properties and functions.

Hierarchy

Expanded class hierarchy of DenormalizedEntityIndexHijack

File

includes/datasource_denormalized_entity.inc, line 541
Contains the SearchApiDenormalizedEntityDataSourceController class.

View source
class DenormalizedEntityIndexHijack extends SearchApiIndex {

  /**
   * Returns the fields to denormalize on.
   *
   * @param SearchApiIndex $index
   *   The index to fetch the configuration from.
   *
   * @return array
   *   The list of fields to use for denormalization.
   */
  public static function getDenormalizeProcessorFields(SearchApiIndex $index) {
    $processors = $index
      ->getProcessors();
    if (!empty($processors['search_api_denormalized_entity_field'])) {
      return $processors['search_api_denormalized_entity_field']
        ->getDenormalizationFields();
    }
    return array();
  }

  /**
   * Returns the permutation limit of a field.
   *
   * @param SearchApiIndex $index
   *   The index to fetch the configuration from.
   * @param string $field
   *   The field to get the limit for.
   *
   * @return int
   *   The number of permutations to generate from this field. 0 means no limit.
   */
  public static function getDenormalizeProcessorFieldLimit(SearchApiIndex $index, $field) {
    $processors = $index
      ->getProcessors();
    if (!empty($processors['search_api_denormalized_entity_field'])) {
      return $processors['search_api_denormalized_entity_field']
        ->getDenormalizationFieldLimit($field);
    }
    return array();
  }

  /**
   * Returns the fields to denormalize on.
   *
   * @param SearchApiIndex $index
   *   The index to fetch the configuration from.
   *
   * @return array
   *   The list of fields to use for denormalization.
   */
  public static function getGroupingProcessorFields(SearchApiIndex $index) {
    $processors = $index
      ->getProcessors();
    if (!empty($processors['search_api_denormalized_entity_grouping'])) {
      return $processors['search_api_denormalized_entity_grouping']
        ->getGroupingFields();
    }
    return array();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
DenormalizedEntityIndexHijack::getDenormalizeProcessorFieldLimit public static function Returns the permutation limit of a field.
DenormalizedEntityIndexHijack::getDenormalizeProcessorFields public static function Returns the fields to denormalize on.
DenormalizedEntityIndexHijack::getGroupingProcessorFields public static function Returns the fields to denormalize on.
Entity::$defaultLabel protected property 1
Entity::$entityInfo protected property
Entity::$entityType protected property
Entity::$idKey protected property
Entity::$wrapper protected property
Entity::buildContent public function Builds a structured array representing the entity's content. Overrides EntityInterface::buildContent 1
Entity::bundle public function Returns the bundle of the entity. Overrides EntityInterface::bundle
Entity::defaultLabel protected function Defines the entity label if the 'entity_class_label' callback is used. 1
Entity::defaultUri protected function Override this in order to implement a custom default URI and specify 'entity_class_uri' as 'uri callback' hook_entity_info().
Entity::delete public function Permanently deletes the entity. Overrides EntityInterface::delete
Entity::entityInfo public function Returns the info of the type of the entity. Overrides EntityInterface::entityInfo
Entity::entityType public function Returns the type of the entity. Overrides EntityInterface::entityType
Entity::export public function Exports the entity. Overrides EntityInterface::export
Entity::getTranslation public function Gets the raw, translated value of a property or field. Overrides EntityInterface::getTranslation
Entity::hasStatus public function Checks if the entity has a certain exportable status. Overrides EntityInterface::hasStatus
Entity::identifier public function Returns the entity identifier, i.e. the entities name or numeric id. Overrides EntityInterface::identifier
Entity::internalIdentifier public function Returns the internal, numeric identifier. Overrides EntityInterface::internalIdentifier
Entity::isDefaultRevision public function Checks whether the entity is the default revision. Overrides EntityInterface::isDefaultRevision
Entity::label public function Returns the label of the entity. Overrides EntityInterface::label
Entity::setUp protected function Set up the object instance on construction or unserializiation.
Entity::uri public function Returns the uri of the entity just as entity_uri(). Overrides EntityInterface::uri
Entity::view public function Generate an array for rendering the entity. Overrides EntityInterface::view
Entity::wrapper public function Returns the EntityMetadataWrapper of the entity. Overrides EntityInterface::wrapper
Entity::__wakeup public function Magic method to invoke setUp() on unserialization.
SearchApiIndex::$added_properties protected property The properties added by data alterations on this index.
SearchApiIndex::$callbacks protected property All enabled data alterations for this index.
SearchApiIndex::$datasource protected property Cached return value of datasource().
SearchApiIndex::$description public property A string describing the index' use to users.
SearchApiIndex::$enabled public property A flag indicating whether this index is enabled.
SearchApiIndex::$fields protected property Static cache for the results of getFields().
SearchApiIndex::$fulltext_fields protected property An array containing two arrays.
SearchApiIndex::$id public property An integer identifying the index. Immutable.
SearchApiIndex::$item_type public property The type of items stored in this index. Immutable.
SearchApiIndex::$machine_name public property The machine name of the index. Immutable.
SearchApiIndex::$name public property A name to be displayed for the index.
SearchApiIndex::$options public property An array of options for configuring this index. The layout is as follows (with all keys being optional):
SearchApiIndex::$processors protected property All enabled processors for this index.
SearchApiIndex::$read_only public property A flag indicating whether to write to this index.
SearchApiIndex::$server public property The machine_name of the server with which data should be indexed.
SearchApiIndex::$server_object protected property Cached return value of server().
SearchApiIndex::clear public function Clears this search index and schedules all of its items for re-indexing.
SearchApiIndex::dataAlter public function Calls data alteration hooks for a set of items, according to the index options.
SearchApiIndex::datasource public function Get the controller object of the data source used by this index.
SearchApiIndex::dequeueItems public function Remove all records of entities to index.
SearchApiIndex::entityWrapper public function Helper function for creating an entity metadata wrapper appropriate for this index.
SearchApiIndex::getAlterCallbacks public function Loads all enabled data alterations for this index in proper order.
SearchApiIndex::getCacheId public function Get the cache ID prefix used for this index's caches.
SearchApiIndex::getEntityType public function Get the entity type of items in this index.
SearchApiIndex::getFields public function Returns a list of all known fields for this index.
SearchApiIndex::getFulltextFields public function Convenience method for getting all of this index's fulltext fields.
SearchApiIndex::getProcessors public function Loads all enabled processors for this index in proper order.
SearchApiIndex::index public function Indexes items on this index.
SearchApiIndex::loadItems public function Helper method to load items from the type lying on this index.
SearchApiIndex::postCreate public function Execute necessary tasks for a newly created index.
SearchApiIndex::postDelete public function Execute necessary tasks when the index is removed from the database.
SearchApiIndex::postprocessSearchResults public function Postprocess search results before display.
SearchApiIndex::preprocessIndexItems public function Preprocess data items for indexing. Data added by data alter callbacks will be available on the items.
SearchApiIndex::preprocessSearchQuery public function Preprocess a search query.
SearchApiIndex::propertyInfoAlter public function Property info alter callback that adds the infos of the properties added by data alter callbacks.
SearchApiIndex::query public function Create a query object for this index.
SearchApiIndex::queueItems public function Record entities to index.
SearchApiIndex::reindex public function Schedules this search index for re-indexing.
SearchApiIndex::resetCaches public function Reset internal caches.
SearchApiIndex::save public function Saves this index to the database. Overrides Entity::save
SearchApiIndex::server public function Get the server this index lies on.
SearchApiIndex::update public function Helper method for updating entity properties.
SearchApiIndex::__construct public function Constructor as a helper to the parent constructor. Overrides Entity::__construct
SearchApiIndex::__sleep public function Magic method for determining which fields should be serialized. Overrides Entity::__sleep