You are here

public function AbstractSolrEntityListBuilder::getAllNotRecommendedEntities in Search API Solr 8.3

Same name and namespace in other branches
  1. 4.x src/Controller/AbstractSolrEntityListBuilder.php \Drupal\search_api_solr\Controller\AbstractSolrEntityListBuilder::getAllNotRecommendedEntities()

Get all not recommended entities.

Return value

array An array of all not recommended entities.

File

src/Controller/AbstractSolrEntityListBuilder.php, line 364

Class

AbstractSolrEntityListBuilder
Provides a listing of Solr Entities.

Namespace

Drupal\search_api_solr\Controller

Code

public function getAllNotRecommendedEntities() : array {

  // Bypass AbstractSolrEntityListBuilder::load() by calling the parent. But
  // don't use parent::load() in case someone copies this function in an
  // inherited class.
  $entities = ConfigEntityListBuilder::load();
  foreach ($entities as $key => $entity) {
    if ($entity
      ->isRecommended()) {
      unset($entities[$key]);
    }
  }
  return $entities;
}