You are here

public static function Migration::entityUsedV2 in CMS Content Sync 2.0.x

Same name and namespace in other branches
  1. 2.1.x src/Controller/Migration.php \Drupal\cms_content_sync\Controller\Migration::entityUsedV2()
3 calls to Migration::entityUsedV2()
PullIntent::execute in src/PullIntent.php
Pull the provided entity.
PushStatusEntityToV2::execute in modules/cms_content_sync_views/src/Plugin/Action/PushStatusEntityToV2.php
Executes the plugin.
SyncCoreEntityItemResource::handleIncomingEntity in src/Plugin/rest/resource/SyncCoreEntityItemResource.php

File

src/Controller/Migration.php, line 99

Class

Migration
Migration Embed provides methods and a UI to migrate from Content Sync v1 to Content Sync v2.

Namespace

Drupal\cms_content_sync\Controller

Code

public static function entityUsedV2(string $flow, string $type, string $bundle, ?string $uuid, ?string $shared_id, bool $pushed) {
  $statuses = self::getStoredFlowStatus($flow);
  foreach ($statuses['types'] as &$status) {
    if ($status['namespaceMachineName'] === $type && $status['machineName'] === $bundle) {
      $status[$pushed ? 'pushedEntity' : 'pulledEntity'] = [
        'remoteUuid' => $uuid,
        'remoteUniqueId' => $shared_id,
        'verified' => false,
      ];
      break;
    }
  }
  self::setFlowStatus($flow, $statuses);
}