You are here

public function AcquiaContentHubEntityCommands::contenthubDelete in Acquia Content Hub 8.2

Deletes a single entity from the Content Hub.

@command acquia:contenthub-delete @aliases ach-del,acquia-contenthub-delete

Parameters

string $uuid: The entity's UUID.

Throws

\Exception

File

src/Commands/AcquiaContentHubEntityCommands.php, line 210

Class

AcquiaContentHubEntityCommands
Drush commands for interacting with Acquia Content Hub entities.

Namespace

Drupal\acquia_contenthub\Commands

Code

public function contenthubDelete($uuid) {
  if (!$this
    ->io()
    ->confirm(dt('Are you sure you want to delete the entity with uuid = @uuid from the Content Hub? There is no way back from this action!', [
    '@uuid' => $uuid,
  ]))) {
    return;
  }
  if ($this->commonActions
    ->deleteRemoteEntity($uuid)) {
    $this
      ->output()
      ->writeln(dt('Entity with UUID = @uuid has been successfully deleted from the Content Hub Service.', [
      '@uuid' => $uuid,
    ]));
    return;
  }
  $this
    ->output()
    ->writeln(dt('WARNING: Entity with UUID = @uuid cannot be deleted from the Content Hub Service.', [
    '@uuid' => $uuid,
  ]));
}