function BlockContentSelection::validateReferenceableNewEntities

Overrides DefaultSelection::validateReferenceableNewEntities

File

core/modules/block_content/src/Plugin/EntityReferenceSelection/BlockContentSelection.php, line 37

Class

BlockContentSelection
Provides specific selection control for the block_content entity type.

Namespace

Drupal\block_content\Plugin\EntityReferenceSelection

Code

public function validateReferenceableNewEntities(array $entities) {
  $entities = parent::validateReferenceableNewEntities($entities);
  // Mirror the conditions checked in buildEntityQuery().
  return array_filter($entities, static fn(BlockContentInterface $blockContent) => $blockContent->isReusable());
}

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