You are here

protected function DefaultUserReferenceHandler::serializeReference in CMS Content Sync 8

Same name and namespace in other branches
  1. 2.1.x src/Plugin/cms_content_sync/field_handler/DefaultUserReferenceHandler.php \Drupal\cms_content_sync\Plugin\cms_content_sync\field_handler\DefaultUserReferenceHandler::serializeReference()
  2. 2.0.x src/Plugin/cms_content_sync/field_handler/DefaultUserReferenceHandler.php \Drupal\cms_content_sync\Plugin\cms_content_sync\field_handler\DefaultUserReferenceHandler::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/DefaultUserReferenceHandler.php, line 97

Class

DefaultUserReferenceHandler
Providing a minimalistic implementation for any field type.

Namespace

Drupal\cms_content_sync\Plugin\cms_content_sync\field_handler

Code

protected function serializeReference(PushIntent $intent, EntityInterface $reference, $value) {
  return [
    self::IDENTIFICATION_EMAIL => $reference
      ->get('mail')->value,
    self::IDENTIFICATION_NAME => $reference
      ->get('name')->value,
  ];
}