You are here

class DrushDeleteCommands in Drush Delete All 3.x

A Drush commandfile for Drush Delete All module.

Hierarchy

Expanded class hierarchy of DrushDeleteCommands

1 string reference to 'DrushDeleteCommands'
drush_delete.services.yml in ./drush_delete.services.yml
drush_delete.services.yml
1 service uses DrushDeleteCommands
drush_delete.commands in ./drush_delete.services.yml
\Drupal\drush_delete\Commands\DrushDeleteCommands

File

src/Commands/DrushDeleteCommands.php, line 10

Namespace

Drupal\drush_delete\Commands
View source
class DrushDeleteCommands extends DrushCommands {

  /**
   * Delete all contents.
   *
   * @param $type
   *   The entity type name
   * @validate-module-enabled drush_delete
   *
   * @command delete:all
   * @aliases delete-all
   */
  public function all($type) {
    $this
      ->output()
      ->writeln(\Drupal::service('drush_delete.entity')
      ->deleteAllEntityType($type));
  }

  /**
   * Delete selected Taxonomy Vocabulary terms.
   *
   * @param $type
   *   The taxonomy vocabulary name
   * @validate-module-enabled drush_delete
   *
   * @command delete:all-taxonomy-vocabulary-term
   * @aliases delete-all-taxonomy-vocabulary-term
   */
  public function allTaxonomyVocabularyTerm($type) {
    $this
      ->output()
      ->writeln(\Drupal::service('drush_delete.entity')
      ->deleteAllTerms($type));
  }

}

Members

Namesort descending Modifiers Type Description Overrides
DrushDeleteCommands::all public function Delete all contents.
DrushDeleteCommands::allTaxonomyVocabularyTerm public function Delete selected Taxonomy Vocabulary terms.