protected function DefaultFieldCollectionItemHandler::createNew in CMS Content Sync 8
Same name and namespace in other branches
- 2.1.x src/Plugin/cms_content_sync/entity_handler/DefaultFieldCollectionItemHandler.php \Drupal\cms_content_sync\Plugin\cms_content_sync\entity_handler\DefaultFieldCollectionItemHandler::createNew()
- 2.0.x src/Plugin/cms_content_sync/entity_handler/DefaultFieldCollectionItemHandler.php \Drupal\cms_content_sync\Plugin\cms_content_sync\entity_handler\DefaultFieldCollectionItemHandler::createNew()
Return value
\Drupal\Core\Entity\EntityInterface
Throws
\Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException
\Drupal\Component\Plugin\Exception\PluginNotFoundException
Overrides EntityHandlerBase::createNew
File
- src/Plugin/ cms_content_sync/ entity_handler/ DefaultFieldCollectionItemHandler.php, line 76 
Class
- DefaultFieldCollectionItemHandler
- Class DefaultFieldCollectionItemHandler.
Namespace
Drupal\cms_content_sync\Plugin\cms_content_sync\entity_handlerCode
protected function createNew(PullIntent $intent) {
  $entity = parent::createNew($intent);
  $parent = DefaultFieldCollectionHandler::$currentPullIntent
    ->getEntity();
  // Respect nested entities.
  if ($parent
    ->isNew()) {
    $parent
      ->save();
  }
  /**
   * @var \Drupal\field_collection\Entity\FieldCollectionItem $entity
   */
  $entity
    ->setHostEntity($parent);
  return $entity;
}