function SelectionWithAutocreateInterface::createNewEntity

Same name in other branches
  1. 9 core/lib/Drupal/Core/Entity/EntityReferenceSelection/SelectionWithAutocreateInterface.php \Drupal\Core\Entity\EntityReferenceSelection\SelectionWithAutocreateInterface::createNewEntity()
  2. 8.9.x core/lib/Drupal/Core/Entity/EntityReferenceSelection/SelectionWithAutocreateInterface.php \Drupal\Core\Entity\EntityReferenceSelection\SelectionWithAutocreateInterface::createNewEntity()
  3. 11.x 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);

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