|
@@ 553-569 (lines=17) @@
|
| 550 |
|
* |
| 551 |
|
* @return \eZ\Publish\API\Repository\Values\Content\Location $location, with updated hidden value |
| 552 |
|
*/ |
| 553 |
|
public function hideLocation(APILocation $location) |
| 554 |
|
{ |
| 555 |
|
if (!$this->repository->canUser('content', 'hide', $location->getContentInfo(), $location)) { |
| 556 |
|
throw new UnauthorizedException('content', 'hide'); |
| 557 |
|
} |
| 558 |
|
|
| 559 |
|
$this->repository->beginTransaction(); |
| 560 |
|
try { |
| 561 |
|
$this->persistenceHandler->locationHandler()->hide($location->id); |
| 562 |
|
$this->repository->commit(); |
| 563 |
|
} catch (Exception $e) { |
| 564 |
|
$this->repository->rollback(); |
| 565 |
|
throw $e; |
| 566 |
|
} |
| 567 |
|
|
| 568 |
|
return $this->loadLocation($location->id); |
| 569 |
|
} |
| 570 |
|
|
| 571 |
|
/** |
| 572 |
|
* Unhides the $location. |
|
@@ 583-599 (lines=17) @@
|
| 580 |
|
* |
| 581 |
|
* @return \eZ\Publish\API\Repository\Values\Content\Location $location, with updated hidden value |
| 582 |
|
*/ |
| 583 |
|
public function unhideLocation(APILocation $location) |
| 584 |
|
{ |
| 585 |
|
if (!$this->repository->canUser('content', 'hide', $location->getContentInfo(), $location)) { |
| 586 |
|
throw new UnauthorizedException('content', 'hide'); |
| 587 |
|
} |
| 588 |
|
|
| 589 |
|
$this->repository->beginTransaction(); |
| 590 |
|
try { |
| 591 |
|
$this->persistenceHandler->locationHandler()->unHide($location->id); |
| 592 |
|
$this->repository->commit(); |
| 593 |
|
} catch (Exception $e) { |
| 594 |
|
$this->repository->rollback(); |
| 595 |
|
throw $e; |
| 596 |
|
} |
| 597 |
|
|
| 598 |
|
return $this->loadLocation($location->id); |
| 599 |
|
} |
| 600 |
|
|
| 601 |
|
/** |
| 602 |
|
* Moves the subtree to $newParentLocation. |