protected function DefaultSelection::reAlterQuery in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/lib/Drupal/Core/Entity/Plugin/EntityReferenceSelection/DefaultSelection.php \Drupal\Core\Entity\Plugin\EntityReferenceSelection\DefaultSelection::reAlterQuery()
Helper method: Passes a query to the alteration system again.
This allows Entity Reference to add a tag to an existing query so it can ask access control mechanisms to alter it again.
1 call to DefaultSelection::reAlterQuery()
- CommentSelection::entityQueryAlter in core/
modules/ comment/ src/ Plugin/ EntityReferenceSelection/ CommentSelection.php - Allows the selection to alter the SelectQuery generated by EntityFieldQuery.
File
- core/
lib/ Drupal/ Core/ Entity/ Plugin/ EntityReferenceSelection/ DefaultSelection.php, line 392 - Contains \Drupal\Core\Entity\Plugin\EntityReferenceSelection\DefaultSelection.
Class
- DefaultSelection
- Default plugin implementation of the Entity Reference Selection plugin.
Namespace
Drupal\Core\Entity\Plugin\EntityReferenceSelectionCode
protected function reAlterQuery(AlterableInterface $query, $tag, $base_table) {
// Save the old tags and metadata.
// For some reason, those are public.
$old_tags = $query->alterTags;
$old_metadata = $query->alterMetaData;
$query->alterTags = array(
$tag => TRUE,
);
$query->alterMetaData['base_table'] = $base_table;
$this->moduleHandler
->alter(array(
'query',
'query_' . $tag,
), $query);
// Restore the tags and metadata.
$query->alterTags = $old_tags;
$query->alterMetaData = $old_metadata;
}