You are here

class SelectionEntityTypeNode in Entity reference 8

Hierarchy

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\Selection
View 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

Namesort descending Modifiers Type Description Overrides
SelectionBase::buildEntityFieldQuery protected function Build an EntityFieldQuery to get referencable entities. 1
SelectionBase::countReferencableEntities public function Implements EntityReferenceHandler::countReferencableEntities(). Overrides SelectionInterface::countReferencableEntities
SelectionBase::getReferencableEntities public function Implements EntityReferenceHandler::getReferencableEntities(). Overrides SelectionInterface::getReferencableEntities
SelectionBase::reAlterQuery protected function Helper method: pass a query to the alteration system again.
SelectionBase::settingsForm public static function Implements EntityReferenceHandler::settingsForm(). Overrides SelectionInterface::settingsForm
SelectionBase::validateAutocompleteInput public function Implements EntityReferenceHandler::validateAutocompleteInput(). Overrides SelectionInterface::validateAutocompleteInput
SelectionBase::validateReferencableEntities public function Implements EntityReferenceHandler::validateReferencableEntities(). Overrides SelectionInterface::validateReferencableEntities
SelectionBase::__construct public function
SelectionEntityTypeNode::entityFieldQueryAlter public function Implements EntityReferenceHandler::entityFieldQueryAlter(). Overrides SelectionBase::entityFieldQueryAlter