You are here

public function FieldCollectionItemInterface::setHostEntity in Field collection 8

Same name and namespace in other branches
  1. 8.3 src/FieldCollectionItemInterface.php \Drupal\field_collection\FieldCollectionItemInterface::setHostEntity()

Sets the host entity. Only possible during creation of a item.

Parameters

\Drupal\Core\Entity\ContentEntityInterface $entity: The host entity to add the the field collection item to.

$create_link: (optional) Whether a field-item linking the host entity to the field collection item should be created. Defaults to TRUE.

1 method overrides FieldCollectionItemInterface::setHostEntity()
FieldCollectionItem::setHostEntity in src/Entity/FieldCollectionItem.php
Sets the host entity. Only possible during creation of a item.

File

src/FieldCollectionItemInterface.php, line 53

Class

FieldCollectionItemInterface
Provides an interface defining a field collection item entity.

Namespace

Drupal\field_collection

Code

public function setHostEntity($entity, $create_link = TRUE);