Skip to content

Commit

Permalink
resave/entries --type
Browse files Browse the repository at this point in the history
resolves #3939
  • Loading branch information
brandonkelly committed Mar 5, 2019
1 parent 3770ae7 commit 61d957f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG-v3.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### Added
- Added the `create()` Twig function. ([#3921](https://github.com/craftcms/cms/pull/3921))
- Added the `--type` option to the `resave/entries` command. ([#3939](https://github.com/craftcms/cms/issues/3939))
- Added `craft\helers\Assets::getAllowedFileKinds()`.

### Changed
Expand Down
9 changes: 9 additions & 0 deletions src/console/controllers/ResaveController.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ class ResaveController extends Controller
*/
public $section;

/**
* @var string|null The entry type handle(s) of the entries to resave.
*/
public $type;

/**
* @var string|null The volume handle(s) to save assets from. Can be set to multiple comma-separated volumes.
*/
Expand Down Expand Up @@ -108,6 +113,7 @@ public function options($actionID)
break;
case 'entries':
$options[] = 'section';
$options[] = 'type';
break;
case 'tags':
$options[] = 'group';
Expand Down Expand Up @@ -159,6 +165,9 @@ public function actionEntries(): int
if ($this->section !== null) {
$query->section(explode(',', $this->section));
}
if ($this->type !== null) {
$query->type(explode(',', $this->type));
}
return $this->_saveElements($query);
}

Expand Down

0 comments on commit 61d957f

Please sign in to comment.