Skip to content

Commit

Permalink
allow settings refs when deleting stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
gggeek committed Jun 6, 2017
1 parent ea8ca57 commit ebc9dde
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 6 deletions.
6 changes: 4 additions & 2 deletions Core/Executor/ContentManager.php
Expand Up @@ -304,10 +304,12 @@ protected function update($step)
*/
protected function delete($step)
{
$contentService = $this->repository->getContentService();

$contentCollection = $this->matchContents('delete', $step);

$this->setReferences($contentCollection, $step);

$contentService = $this->repository->getContentService();

foreach ($contentCollection as $content) {
try {
$contentService->deleteContent($content->contentInfo);
Expand Down
2 changes: 2 additions & 0 deletions Core/Executor/ContentTypeGroupManager.php
Expand Up @@ -86,6 +86,8 @@ protected function delete($step)
{
$groupsCollection = $this->matchContentTypeGroups('delete', $step);

$this->setReferences($groupsCollection, $step);

$contentTypeService = $this->repository->getContentTypeService();

foreach ($groupsCollection as $contentTypeGroup) {
Expand Down
2 changes: 2 additions & 0 deletions Core/Executor/ContentTypeManager.php
Expand Up @@ -252,6 +252,8 @@ protected function delete($step)
{
$contentTypeCollection = $this->matchContentTypes('delete', $step);

$this->setReferences($contentTypeCollection, $step);

$contentTypeService = $this->repository->getContentTypeService();

foreach ($contentTypeCollection as $contentType) {
Expand Down
6 changes: 4 additions & 2 deletions Core/Executor/LocationManager.php
Expand Up @@ -203,10 +203,12 @@ protected function update($step)
*/
protected function delete($step)
{
$locationService = $this->repository->getLocationService();

$locationCollection = $this->matchLocations('delete', $step);

$this->setReferences($locationCollection, $step);

$locationService = $this->repository->getLocationService();

foreach ($locationCollection as $location) {
$locationService->deleteLocation($location);
}
Expand Down
2 changes: 2 additions & 0 deletions Core/Executor/ObjectStateGroupManager.php
Expand Up @@ -113,6 +113,8 @@ protected function delete($step)
{
$groupsCollection = $this->matchObjectStateGroups('delete', $step);

$this->setReferences($groupsCollection, $step);

$objectStateService = $this->repository->getObjectStateService();

foreach ($groupsCollection as $objectStateGroup) {
Expand Down
2 changes: 2 additions & 0 deletions Core/Executor/ObjectStateManager.php
Expand Up @@ -129,6 +129,8 @@ protected function delete($step)
{
$stateCollection = $this->matchObjectStates('delete', $step);

$this->setReferences($stateCollection, $step);

$objectStateService = $this->repository->getObjectStateService();

foreach ($stateCollection as $state) {
Expand Down
2 changes: 2 additions & 0 deletions Core/Executor/RoleManager.php
Expand Up @@ -119,6 +119,8 @@ protected function delete($step)
{
$roleCollection = $this->matchRoles('delete', $step);

$this->setReferences($roleCollection, $step);

$roleService = $this->repository->getRoleService();

foreach ($roleCollection as $role) {
Expand Down
2 changes: 2 additions & 0 deletions Core/Executor/SectionManager.php
Expand Up @@ -82,6 +82,8 @@ protected function delete($step)
{
$sectionCollection = $this->matchSections('delete', $step);

$this->setReferences($sectionCollection, $step);

$sectionService = $this->repository->getSectionService();

foreach ($sectionCollection as $section) {
Expand Down
2 changes: 2 additions & 0 deletions Core/Executor/TagManager.php
Expand Up @@ -85,6 +85,8 @@ protected function delete($step)

$tagsCollection = $this->matchTags('delete', $step);

$this->setReferences($tagsCollection, $step);

foreach ($tagsCollection as $tag) {
$this->tagService->deleteTag($tag);
}
Expand Down
2 changes: 2 additions & 0 deletions Core/Executor/UserGroupManager.php
Expand Up @@ -143,6 +143,8 @@ protected function delete($step)
{
$userGroupCollection = $this->matchUserGroups('delete', $step);

$this->setReferences($userGroupCollection, $step);

$userService = $this->repository->getUserService();

foreach ($userGroupCollection as $userGroup) {
Expand Down
2 changes: 2 additions & 0 deletions Core/Executor/UserManager.php
Expand Up @@ -160,6 +160,8 @@ protected function delete($step)
{
$userCollection = $this->matchUsers('delete', $step);

$this->setReferences($userCollection, $step);

$userService = $this->repository->getUserService();

foreach ($userCollection as $user) {
Expand Down
6 changes: 4 additions & 2 deletions WHATSNEW.md
Expand Up @@ -3,16 +3,18 @@ Version 4.0 RC-4 (unreleased)

* New: added 'append' action to 'file' executor

* New: it is now possible to match contents based on what other contents they relate to/from

* New: it is now possible to set a reference to a Content State by using a syntax similar to f.e. `object_state.ez_lock` to
specify the desired State Group

* New: allow to use a reference for Migration/Suspend when comparing to a date

* New: it is now possible to match contents based on what other contents they relate to/from

* New: allow to set references to the number of items matched whenever updating/deleting any entity from the repository
(contents, locations, etc...)

* New: allow to set references when deleting any entity from the repository

* New: allow to install along newer with Nikic/php- parser

* Fix the Migration/Cancel step
Expand Down

0 comments on commit ebc9dde

Please sign in to comment.