You are here

protected function ParagraphsItemEntity::deleteHostEntityReference in Paragraphs 7

Deletes the host entity's reference of the paragraphs item.

1 call to ParagraphsItemEntity::deleteHostEntityReference()
ParagraphsItemEntity::deleteRevision in ./ParagraphsItemEntity.inc
Intelligently delete a paragraphs item revision.

File

./ParagraphsItemEntity.inc, line 425

Class

ParagraphsItemEntity
Entity implementation for the paragraphs entity.

Code

protected function deleteHostEntityReference() {
  $delta = $this
    ->delta();
  if ($this->item_id && isset($delta)) {
    unset($this->hostEntity->{$this->field_name}[$this->langcode][$delta]);
    entity_save($this->hostEntityType, $this->hostEntity);
  }
}