public function AbstractSolrEntityListBuilder::getConflictingEntities in Search API Solr 8.3
Same name and namespace in other branches
- 4.x src/Controller/AbstractSolrEntityListBuilder.php \Drupal\search_api_solr\Controller\AbstractSolrEntityListBuilder::getConflictingEntities()
Get all conflicting entities.
Return value
array An array of all conflicting entities.
1 call to AbstractSolrEntityListBuilder::getConflictingEntities()
- AbstractSolrEntityListBuilder::getEnabledEntities in src/
Controller/ AbstractSolrEntityListBuilder.php - Returns a list of all enabled Solr config entities for current server.
File
- src/
Controller/ AbstractSolrEntityListBuilder.php, line 383
Class
- AbstractSolrEntityListBuilder
- Provides a listing of Solr Entities.
Namespace
Drupal\search_api_solr\ControllerCode
public function getConflictingEntities(array $entities) : array {
$conflicting_entities = [];
$purpose_ids = [];
foreach ($entities as $key => $entity) {
$purpose_id = $entity
->getPurposeId();
if (!in_array($purpose_id, $purpose_ids)) {
$purpose_ids[] = $purpose_id;
}
else {
$conflicting_entities[$key] = $entity;
}
}
return $conflicting_entities;
}