SelectionWithAutocreateInterface
interface SelectionWithAutocreateInterface (View source)
Interface for Selection plugins that support newly created entities.
Methods
createNewEntity(string $entity_type_id, string $bundle, string $label, int $uid)
Creates a new entity object that can be used as a valid reference.
validateReferenceableNewEntities(array $entities)
Validates which newly created entities can be referenced.
Details
EntityInterface
createNewEntity(string $entity_type_id, string $bundle, string $label, int $uid)
Creates a new entity object that can be used as a valid reference.
EntityInterface[]
validateReferenceableNewEntities(array $entities)
Validates which newly created entities can be referenced.
This method should replicate the logic implemented by \Drupal\Core\Entity\EntityReferenceSelection\SelectionInterface::validateReferenceableEntities(), but applied to newly created entities that have not been saved yet.