You are here

public function SelectionWithAutocreateInterface::createNewEntity in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Entity/EntityReferenceSelection/SelectionWithAutocreateInterface.php \Drupal\Core\Entity\EntityReferenceSelection\SelectionWithAutocreateInterface::createNewEntity()
  2. 9 core/lib/Drupal/Core/Entity/EntityReferenceSelection/SelectionWithAutocreateInterface.php \Drupal\Core\Entity\EntityReferenceSelection\SelectionWithAutocreateInterface::createNewEntity()

Creates a new entity object that can be used as a valid reference.

Parameters

string $entity_type_id: The entity type ID.

string $bundle: The bundle name.

string $label: The entity label.

int $uid: The entity owner ID, if the entity type supports it.

Return value

\Drupal\Core\Entity\EntityInterface An unsaved entity object.

1 method overrides SelectionWithAutocreateInterface::createNewEntity()
DefaultSelection::createNewEntity in core/lib/Drupal/Core/Entity/Plugin/EntityReferenceSelection/DefaultSelection.php
Creates a new entity object that can be used as a valid reference.

File

core/lib/Drupal/Core/Entity/EntityReferenceSelection/SelectionWithAutocreateInterface.php, line 29

Class

SelectionWithAutocreateInterface
Interface for Selection plugins that support newly created entities.

Namespace

Drupal\Core\Entity\EntityReferenceSelection

Code

public function createNewEntity($entity_type_id, $bundle, $label, $uid);