Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
default_content
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
default_content
Merge requests
!45
Resolve
#3282547
"Drush delete content reimport"
Code
Review changes
Check out branch
Open in Workspace
Download
Patches
Plain diff
Expand sidebar
Open
Resolve
#3282547
"Drush delete content reimport"
issue/default_content-3282547:3282547-drush-delete-content-reimport
into
2.0.x
Overview
3
Commits
8
Pipelines
0
Changes
5
1 open thread
Show all comments
Open
Resolve #3282547 "Drush delete content reimport"
eduardo morales alberti
requested to merge
issue/default_content-3282547:3282547-drush-delete-content-reimport
into
2.0.x
Mar 25, 2024
Overview
3
Commits
8
Pipelines
0
Changes
5
1 open thread
Show all comments
Closes
#3282547
0
0
Merge request reports
Compare
2.0.x
version 5
4a9fb8d3
4 months ago
version 4
cb76431e
4 months ago
version 3
e1b19575
Mar 25, 2024
version 2
e02cf371
Mar 25, 2024
version 1
4f0a3fd7
Mar 25, 2024
2.0.x (HEAD)
and
latest version
latest version
342b06eb
8 commits,
4 months ago
version 5
4a9fb8d3
7 commits,
4 months ago
version 4
cb76431e
6 commits,
4 months ago
version 3
e1b19575
5 commits,
Mar 25, 2024
version 2
e02cf371
4 commits,
Mar 25, 2024
version 1
4f0a3fd7
3 commits,
Mar 25, 2024
5 files
+
242
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
5
src/Commands/DefaultContentDeleteCommands.php
0 → 100644
+
73
−
0
View file @ 983c93ec
Edit in single-file editor
Open in Web IDE
<?php
namespace
Drupal\default_content\Commands
;
use
Drupal\default_content
\DeleterInterface
;
use
Drupal\default_content
\ImporterInterface
;
use
Drush\Commands\DrushCommands
;
/**
* Deletes and/or import module content.
*
* @package Drupal\default_content
*/
class
DefaultContentDeleteCommands
extends
DrushCommands
{
/**
* The default content deleter.
*
* @var \Drupal\default_content\DeleterInterface
*/
protected
DeleterInterface
$defaultContentDeleter
;
/**
* The default content importer.
*
* @var \Drupal\default_content\ImporterInterface
*/
protected
ImporterInterface
$defaultContentImporter
;
/**
* DefaultContentDeleteCommands constructor.
*
* @param \Drupal\default_content\DeleterInterface $default_content_deleter
* The default content deleter.
* @param \Drupal\default_content\ImporterInterface $default_content_importer
* The default content importer.
*/
public
function
__construct
(
DeleterInterface
$default_content_deleter
,
ImporterInterface
$default_content_importer
)
{
parent
::
__construct
();
$this
->
defaultContentDeleter
=
$default_content_deleter
;
$this
->
defaultContentImporter
=
$default_content_importer
;
}
/**
* Deletes all the content defined in a module's content folder.
*
* @param string $module
* The name of the module.
*
* @command default-content:delete-module
* @aliases dcdm
*/
public
function
contentDeleteModule
(
$module
)
{
$this
->
defaultContentDeleter
->
deleteModuleContent
(
$module
);
}
/**
* Deletes the content defined in a module's content and imports it again.
*
* @param string $module
* The name of the module.
*
* @command default-content:reimport-module
* @aliases dcrm
*/
public
function
contentReimportModule
(
$module
)
{
$this
->
logger
()
->
notice
(
'Deleting default content from module '
.
$module
);
$this
->
defaultContentDeleter
->
deleteModuleContent
(
$module
);
$this
->
logger
()
->
notice
(
'Reimporting default content.'
);
$this
->
defaultContentImporter
->
importContent
(
$module
);
}
}
Loading