function ViewsSelection::getDisplayExecutionResults

Same name in other branches
  1. 8.9.x core/modules/views/src/Plugin/EntityReferenceSelection/ViewsSelection.php \Drupal\views\Plugin\EntityReferenceSelection\ViewsSelection::getDisplayExecutionResults()
  2. 10 core/modules/views/src/Plugin/EntityReferenceSelection/ViewsSelection.php \Drupal\views\Plugin\EntityReferenceSelection\ViewsSelection::getDisplayExecutionResults()
  3. 11.x core/modules/views/src/Plugin/EntityReferenceSelection/ViewsSelection.php \Drupal\views\Plugin\EntityReferenceSelection\ViewsSelection::getDisplayExecutionResults()

Fetches the results of executing the display.

Parameters

string|null $match: (Optional) Text to match the label against. Defaults to NULL.

string $match_operator: (Optional) The operation the matching should be done with. Defaults to "CONTAINS".

int $limit: Limit the query to a given number of items. Defaults to 0, which indicates no limiting.

array|null $ids: Array of entity IDs. Defaults to NULL.

Return value

array The results.

2 calls to ViewsSelection::getDisplayExecutionResults()
ViewsSelection::getReferenceableEntities in core/modules/views/src/Plugin/EntityReferenceSelection/ViewsSelection.php
Gets the list of referenceable entities.
ViewsSelection::validateReferenceableEntities in core/modules/views/src/Plugin/EntityReferenceSelection/ViewsSelection.php
Validates which existing entities can be referenced.

File

core/modules/views/src/Plugin/EntityReferenceSelection/ViewsSelection.php, line 257

Class

ViewsSelection
Plugin implementation of the 'selection' entity_reference.

Namespace

Drupal\views\Plugin\EntityReferenceSelection

Code

protected function getDisplayExecutionResults(string $match = NULL, string $match_operator = 'CONTAINS', int $limit = 0, array $ids = NULL) {
    $display_name = $this->getConfiguration()['view']['display_name'];
    $arguments = $this->getConfiguration()['view']['arguments'];
    $results = [];
    if ($this->initializeView($match, $match_operator, $limit, $ids)) {
        $results = $this->view
            ->executeDisplay($display_name, $arguments);
    }
    return $results;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.