|
@@ 33-56 (lines=24) @@
|
| 30 |
|
/** |
| 31 |
|
* {@inheritdoc} |
| 32 |
|
*/ |
| 33 |
|
public function trashSubtree($locationId) |
| 34 |
|
{ |
| 35 |
|
$this->logger->logCall(__METHOD__, array('locationId' => $locationId)); |
| 36 |
|
|
| 37 |
|
$location = $this->persistenceHandler->locationHandler()->load($locationId); |
| 38 |
|
$reverseRelations = $this->persistenceHandler->contentHandler()->loadRelations($location->contentId); |
| 39 |
|
|
| 40 |
|
$return = $this->persistenceHandler->trashHandler()->trashSubtree($locationId); |
| 41 |
|
|
| 42 |
|
$tags = []; |
| 43 |
|
if (!empty($reverseRelations)) { |
| 44 |
|
$tags = array_map(function (Relation $relation) { |
| 45 |
|
return 'content-fields-' . $relation->destinationContentId; |
| 46 |
|
}, $reverseRelations); |
| 47 |
|
} |
| 48 |
|
|
| 49 |
|
$this->cache->invalidateTags([ |
| 50 |
|
'content-' . $location->contentId, |
| 51 |
|
'content-fields-' . $location->contentId, |
| 52 |
|
'location-' . $locationId, 'location-path-' . $locationId, |
| 53 |
|
] + $tags); |
| 54 |
|
|
| 55 |
|
return $return; |
| 56 |
|
} |
| 57 |
|
|
| 58 |
|
/** |
| 59 |
|
* {@inheritdoc} |
|
@@ 61-84 (lines=24) @@
|
| 58 |
|
/** |
| 59 |
|
* {@inheritdoc} |
| 60 |
|
*/ |
| 61 |
|
public function recover($trashedId, $newParentId) |
| 62 |
|
{ |
| 63 |
|
$this->logger->logCall(__METHOD__, array('id' => $trashedId, 'newParentId' => $newParentId)); |
| 64 |
|
|
| 65 |
|
$return = $this->persistenceHandler->trashHandler()->recover($trashedId, $newParentId); |
| 66 |
|
|
| 67 |
|
$location = $this->persistenceHandler->locationHandler()->load($return); |
| 68 |
|
$reverseRelations = $this->persistenceHandler->contentHandler()->loadRelations($location->contentId); |
| 69 |
|
|
| 70 |
|
$tags = []; |
| 71 |
|
if (!empty($reverseRelations)) { |
| 72 |
|
$tags = array_map(function (Relation $relation) { |
| 73 |
|
return 'content-fields-' . $relation->destinationContentId; |
| 74 |
|
}, $reverseRelations); |
| 75 |
|
} |
| 76 |
|
|
| 77 |
|
$this->cache->invalidateTags([ |
| 78 |
|
'content-' . $location->contentId, |
| 79 |
|
'content-fields-' . $location->contentId, |
| 80 |
|
'location-' . $trashedId, 'location-path-' . $trashedId, |
| 81 |
|
] + $tags); |
| 82 |
|
|
| 83 |
|
return $return; |
| 84 |
|
} |
| 85 |
|
|
| 86 |
|
/** |
| 87 |
|
* {@inheritdoc} |