| @@ 83-98 (lines=16) @@ | ||
| 80 | * |
|
| 81 | * @return null|\eZ\Publish\API\Repository\Values\Content\TrashItem null if location was deleted, otherwise TrashItem |
|
| 82 | */ |
|
| 83 | public function trash(Location $location) |
|
| 84 | { |
|
| 85 | $returnValue = $this->service->trash($location); |
|
| 86 | $this->signalDispatcher->emit( |
|
| 87 | new TrashSignal( |
|
| 88 | array( |
|
| 89 | 'locationId' => $location->id, |
|
| 90 | 'parentLocationId' => $location->parentLocationId, |
|
| 91 | 'contentId' => $location->contentId, |
|
| 92 | 'contentTrashed' => $returnValue instanceof TrashItem, |
|
| 93 | ) |
|
| 94 | ) |
|
| 95 | ); |
|
| 96 | ||
| 97 | return $returnValue; |
|
| 98 | } |
|
| 99 | ||
| 100 | /** |
|
| 101 | * Recovers the $trashedLocation at its original place if possible. |
|
| @@ 234-249 (lines=16) @@ | ||
| 231 | * @param \eZ\Publish\API\Repository\Values\Content\Location $location1 |
|
| 232 | * @param \eZ\Publish\API\Repository\Values\Content\Location $location2 |
|
| 233 | */ |
|
| 234 | public function swapLocation(Location $location1, Location $location2) |
|
| 235 | { |
|
| 236 | $returnValue = $this->service->swapLocation($location1, $location2); |
|
| 237 | $this->signalDispatcher->emit( |
|
| 238 | new SwapLocationSignal( |
|
| 239 | array( |
|
| 240 | 'location1Id' => $location1->id, |
|
| 241 | 'content1Id' => $location1->contentId, |
|
| 242 | 'location2Id' => $location2->id, |
|
| 243 | 'content2Id' => $location2->contentId, |
|
| 244 | ) |
|
| 245 | ) |
|
| 246 | ); |
|
| 247 | ||
| 248 | return $returnValue; |
|
| 249 | } |
|
| 250 | ||
| 251 | /** |
|
| 252 | * Hides the $location and marks invisible all descendants of $location. |
|