You are here

class CMSContentSyncDeveloperCommands in CMS Content Sync 2.0.x

Same name and namespace in other branches
  1. 8 modules/cms_content_sync_developer/src/Commands/CMSContentSyncDeveloperCommands.php \Drupal\cms_content_sync_developer\Commands\CMSContentSyncDeveloperCommands
  2. 2.1.x modules/cms_content_sync_developer/src/Commands/CMSContentSyncDeveloperCommands.php \Drupal\cms_content_sync_developer\Commands\CMSContentSyncDeveloperCommands

Content Sync Developer Drush Commands.

Hierarchy

Expanded class hierarchy of CMSContentSyncDeveloperCommands

1 string reference to 'CMSContentSyncDeveloperCommands'
drush.services.yml in modules/cms_content_sync_developer/drush.services.yml
modules/cms_content_sync_developer/drush.services.yml
1 service uses CMSContentSyncDeveloperCommands
cms_content_sync_developer.commands in modules/cms_content_sync_developer/drush.services.yml
\Drupal\cms_content_sync_developer\Commands\CMSContentSyncDeveloperCommands

File

modules/cms_content_sync_developer/src/Commands/CMSContentSyncDeveloperCommands.php, line 11

Namespace

Drupal\cms_content_sync_developer\Commands
View source
class CMSContentSyncDeveloperCommands extends DrushCommands {

  /**
   * The interoperability cli service.
   *
   * @var \Drupal\cms_content_sync_developer\Cli\CliService
   */
  protected $cliService;

  /**
   * CMS Content Sync constructor.
   *
   * @param \Drupal\cms_content_sync_developer\Cli\CliService $cliService
   *   The CLI service which allows interoperability.
   */
  public function __construct(CliService $cliService) {
    $this->cliService = $cliService;
    parent::__construct();
  }

  /**
   * @return \Symfony\Component\Console\Style\SymfonyStyle|ICLIIO
   */
  protected function io() {
    return parent::io();
  }

  /**
   * Export the configuration to the Sync Core.
   *
   * @command cms_content_sync_developer:update-flows
   * @aliases csuf
   */
  public function configuration_export() {
    $this->cliService
      ->configuration_export($this
      ->io());
  }

  /**
   * Force the deletion of entities and skip the syndication.
   *
   * @command cms_content_sync_developer:force-entity-deletion
   *
   * @aliases csfed
   *
   * @param string $entity_type
   *   The entity type the entities should be deleted for.
   * @param array $options
   *
   * @options bundle
   *  The bundle the entities should be deleted for.
   * @options entity_uuid
   *  The entities uuid that should be deleted.
   *
   * @usage cms_content_sync_developer:force_entity_deletion node --entity_uuid="06d1d5b8-5583-4929-9f7c-c85cfe59440b"
   *  Force delete the node having the uuid: "06d1d5b8-5583-4929-9f7c-c85cfe59440b".
   * @usage cms_content_sync_developer:force_entity_deletion node --bundle="basic_page"
   *  Force delete all nodes having the bundle basic_page.
   *
   * @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException
   * @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException
   * @throws \Drupal\Core\Entity\EntityStorageException
   * @throws \Drush\Exceptions\UserAbortException
   */
  public function force_entity_deletion($entity_type, $options = [
    'bundle' => NULL,
    'entity_uuid' => NULL,
  ]) {
    $this->cliService
      ->force_entity_deletion($this
      ->io(), $entity_type, $options);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
CMSContentSyncDeveloperCommands::$cliService protected property The interoperability cli service.
CMSContentSyncDeveloperCommands::configuration_export public function Export the configuration to the Sync Core.
CMSContentSyncDeveloperCommands::force_entity_deletion public function Force the deletion of entities and skip the syndication.
CMSContentSyncDeveloperCommands::io protected function
CMSContentSyncDeveloperCommands::__construct public function CMS Content Sync constructor.