class SelectionEntityTypeNode in Entity reference 8
Hierarchy
- class \Drupal\entityreference\Plugin\entityreference\selection\SelectionBase implements SelectionInterface
- class \Drupal\entityreference\Plugin\Type\Selection\SelectionEntityTypeNode
Expanded class hierarchy of SelectionEntityTypeNode
File
- lib/
Drupal/ entityreference/ Plugin/ Type/ Selection/ SelectionEntityTypeNode.php, line 17 - Definition of Drupal\entityreference\Plugin\entityreference\selection\SelectionEntityTypeNode.
Namespace
Drupal\entityreference\Plugin\Type\SelectionView source
class SelectionEntityTypeNode extends SelectionBase {
public function entityFieldQueryAlter(AlterableInterface $query) {
// Adding the 'node_access' tag is sadly insufficient for nodes: core
// requires us to also know about the concept of 'published' and
// 'unpublished'. We need to do that as long as there are no access control
// modules in use on the site. As long as one access control module is there,
// it is supposed to handle this check.
if (!user_access('bypass node access') && !count(module_implements('node_grants'))) {
$tables = $query
->getTables();
$query
->condition(key($tables) . '.status', NODE_PUBLISHED);
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
SelectionBase:: |
protected | function | Build an EntityFieldQuery to get referencable entities. | 1 |
SelectionBase:: |
public | function |
Implements EntityReferenceHandler::countReferencableEntities(). Overrides SelectionInterface:: |
|
SelectionBase:: |
public | function |
Implements EntityReferenceHandler::getReferencableEntities(). Overrides SelectionInterface:: |
|
SelectionBase:: |
protected | function | Helper method: pass a query to the alteration system again. | |
SelectionBase:: |
public static | function |
Implements EntityReferenceHandler::settingsForm(). Overrides SelectionInterface:: |
|
SelectionBase:: |
public | function |
Implements EntityReferenceHandler::validateAutocompleteInput(). Overrides SelectionInterface:: |
|
SelectionBase:: |
public | function |
Implements EntityReferenceHandler::validateReferencableEntities(). Overrides SelectionInterface:: |
|
SelectionBase:: |
public | function | ||
SelectionEntityTypeNode:: |
public | function |
Implements EntityReferenceHandler::entityFieldQueryAlter(). Overrides SelectionBase:: |