You are here

private function Importer::appendToUpdate in Feeds Paragraphs 8

Mark updated Paragraphs entity for creating new revision.

Parameters

Paragraph $paragraph: The Paragraphs entity to mark for revisioning.

See also

Importer::createRevision()

1 call to Importer::appendToUpdate()
Importer::import in src/Importer.php

File

src/Importer.php, line 153

Class

Importer

Namespace

Drupal\feeds_para_mapper

Code

private function appendToUpdate($paragraph) {

  // Add to the entity some information about the current target:
  $paragraphs = array();
  if (count($this->targetInfo->paragraphs)) {
    $paragraphs = $this->targetInfo->paragraphs;
  }
  $paragraphs[] = $paragraph;
  $this->targetInfo->paragraphs = $paragraphs;
  $this->target
    ->set('target_info', $this->targetInfo);
  $fpm_targets = array();
  if (isset($this->entity->fpm_targets)) {
    $fpm_targets = $this->entity->fpm_targets;
  }
  $current_target = $this->target
    ->getName();
  $fpm_targets[$current_target] = $this->target;
  $this->entity->fpm_targets = $fpm_targets;
}