|
@@ 563-579 (lines=17) @@
|
| 560 |
|
* |
| 561 |
|
* @return \eZ\Publish\API\Repository\Values\Content\Location $location, with updated hidden value |
| 562 |
|
*/ |
| 563 |
|
public function hideLocation(APILocation $location) |
| 564 |
|
{ |
| 565 |
|
if (!$this->repository->canUser('content', 'hide', $location->getContentInfo(), $location)) { |
| 566 |
|
throw new UnauthorizedException('content', 'hide'); |
| 567 |
|
} |
| 568 |
|
|
| 569 |
|
$this->repository->beginTransaction(); |
| 570 |
|
try { |
| 571 |
|
$this->persistenceHandler->locationHandler()->hide($location->id); |
| 572 |
|
$this->repository->commit(); |
| 573 |
|
} catch (Exception $e) { |
| 574 |
|
$this->repository->rollback(); |
| 575 |
|
throw $e; |
| 576 |
|
} |
| 577 |
|
|
| 578 |
|
return $this->loadLocation($location->id); |
| 579 |
|
} |
| 580 |
|
|
| 581 |
|
/** |
| 582 |
|
* Unhides the $location. |
|
@@ 593-609 (lines=17) @@
|
| 590 |
|
* |
| 591 |
|
* @return \eZ\Publish\API\Repository\Values\Content\Location $location, with updated hidden value |
| 592 |
|
*/ |
| 593 |
|
public function unhideLocation(APILocation $location) |
| 594 |
|
{ |
| 595 |
|
if (!$this->repository->canUser('content', 'hide', $location->getContentInfo(), $location)) { |
| 596 |
|
throw new UnauthorizedException('content', 'hide'); |
| 597 |
|
} |
| 598 |
|
|
| 599 |
|
$this->repository->beginTransaction(); |
| 600 |
|
try { |
| 601 |
|
$this->persistenceHandler->locationHandler()->unHide($location->id); |
| 602 |
|
$this->repository->commit(); |
| 603 |
|
} catch (Exception $e) { |
| 604 |
|
$this->repository->rollback(); |
| 605 |
|
throw $e; |
| 606 |
|
} |
| 607 |
|
|
| 608 |
|
return $this->loadLocation($location->id); |
| 609 |
|
} |
| 610 |
|
|
| 611 |
|
/** |
| 612 |
|
* Moves the subtree to $newParentLocation. |