You are here

cms_content_sync_migrate_acquia_content_hub.module in CMS Content Sync 2.1.x

File

modules/cms_content_sync_migrate_acquia_content_hub/cms_content_sync_migrate_acquia_content_hub.module
View source
<?php

/**
 * @file
 */
use Drupal\Core\Entity\EntityInterface;
use Drupal\acquia_contenthub_subscriber\Entity\ContentHubFilter;
use Drupal\Core\Url;

/**
 * Implements hook_entity_operation_alter().
 */
function cms_content_sync_migrate_acquia_content_hub_entity_operation_alter(array &$operations, EntityInterface $entity) {
  if ($entity instanceof ContentHubFilter) {
    $operations['create_pull_flow'] = [
      'title' => t('Migrate to Content Sync'),
      'weight' => 150,
      'url' => Url::fromRoute('cms_content_sync_migrate_acquia_content_hub.migrate_pull', [
        'content_hub_filter_id' => $entity
          ->id(),
      ]),
    ];
  }
}