protected function DefaultFieldCollectionHandler::loadReferencedEntityFromFieldValue in CMS Content Sync 8
Same name and namespace in other branches
- 2.1.x src/Plugin/cms_content_sync/field_handler/DefaultFieldCollectionHandler.php \Drupal\cms_content_sync\Plugin\cms_content_sync\field_handler\DefaultFieldCollectionHandler::loadReferencedEntityFromFieldValue()
- 2.0.x src/Plugin/cms_content_sync/field_handler/DefaultFieldCollectionHandler.php \Drupal\cms_content_sync\Plugin\cms_content_sync\field_handler\DefaultFieldCollectionHandler::loadReferencedEntityFromFieldValue()
Load the referenced entity, given the $entity->field_* value.
Parameters
$value:
Return value
null|\Drupal\Core\Entity\EntityInterface
Throws
\Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException
\Drupal\Component\Plugin\Exception\PluginNotFoundException
Overrides EntityReferenceHandlerBase::loadReferencedEntityFromFieldValue
File
- src/
Plugin/ cms_content_sync/ field_handler/ DefaultFieldCollectionHandler.php, line 81
Class
- DefaultFieldCollectionHandler
- Providing a minimalistic implementation for any field type.
Namespace
Drupal\cms_content_sync\Plugin\cms_content_sync\field_handlerCode
protected function loadReferencedEntityFromFieldValue($value) {
if (empty($value['revision_id'])) {
return null;
}
return \Drupal::entityTypeManager()
->getStorage('field_collection_item')
->loadRevision($value['revision_id']);
}