protected function DefaultWebformHandler::serializeReference in CMS Content Sync 8
Same name and namespace in other branches
- 2.1.x src/Plugin/cms_content_sync/field_handler/DefaultWebformHandler.php \Drupal\cms_content_sync\Plugin\cms_content_sync\field_handler\DefaultWebformHandler::serializeReference()
- 2.0.x src/Plugin/cms_content_sync/field_handler/DefaultWebformHandler.php \Drupal\cms_content_sync\Plugin\cms_content_sync\field_handler\DefaultWebformHandler::serializeReference()
Parameters
$value:
Return value
array
Throws
\Drupal\Core\Entity\EntityStorageException
\Drupal\cms_content_sync\Exception\SyncException
\GuzzleHttp\Exception\GuzzleException
Overrides EntityReferenceHandlerBase::serializeReference
File
- src/
Plugin/ cms_content_sync/ field_handler/ DefaultWebformHandler.php, line 93
Class
- DefaultWebformHandler
- Implements webform references.
Namespace
Drupal\cms_content_sync\Plugin\cms_content_sync\field_handlerCode
protected function serializeReference(PushIntent $intent, EntityInterface $reference, $value) {
if ($this
->shouldEmbedReferencedEntities()) {
return $intent
->embed($reference, $value);
}
if ($this
->shouldPushReferencedEntities()) {
return $intent
->addDependency($reference, $value);
}
return $intent
->addReference($reference, $value);
}