public function SelectionWithAutocreateInterface::createNewEntity

public SelectionWithAutocreateInterface::createNewEntity($entity_type_id, $bundle, $label, $uid)

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.

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);

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Entity!EntityReferenceSelection!SelectionWithAutocreateInterface.php/function/SelectionWithAutocreateInterface::createNewEntity/8.1.x