Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. SelectionWithAutocreateInterface.php

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

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal