function search_api_entity_insert in Search API 8
Same name and namespace in other branches
- 7 search_api.module \search_api_entity_insert()
Implements hook_entity_insert().
Note that this function implements tracking only on behalf of the "Content Entity" datasource defined in this module, not for entity-based datasources in general. Datasources defined by other modules still have to implement their own mechanism for tracking new/updated/deleted entities.
See also
\Drupal\search_api\Plugin\search_api\datasource\ContentEntityTrackingManager::entityInsert()
File
- ./
search_api.module, line 201 - Provides a rich framework for creating searches.
Code
function search_api_entity_insert(EntityInterface $entity) {
// Call this hook on behalf of the Content Entity datasource.
\Drupal::getContainer()
->get('search_api.entity_datasource.tracking_manager')
->entityInsert($entity);
}