public function AbstractSolrEntityListBuilder::getRecommendedEntities 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::getRecommendedEntities()
Get all recommended Entities.
Return value
array An array of all recommended entities.
Throws
\Drupal\search_api\SearchApiException
File
- src/
Controller/ AbstractSolrEntityListBuilder.php, line 311
Class
- AbstractSolrEntityListBuilder
- Provides a listing of Solr Entities.
Namespace
Drupal\search_api_solr\ControllerCode
public function getRecommendedEntities() : array {
$entities = $this
->load();
foreach ($entities as $key => $entity) {
if (!$entity
->isRecommended()) {
unset($entities[$key]);
}
}
return $entities;
}