|
@@ 528-544 (lines=17) @@
|
| 525 |
|
* |
| 526 |
|
* @return \eZ\Publish\API\Repository\Values\Content\Location $location, with updated hidden value |
| 527 |
|
*/ |
| 528 |
|
public function hideLocation(APILocation $location) |
| 529 |
|
{ |
| 530 |
|
if (!$this->repository->canUser('content', 'hide', $location->getContentInfo(), $location)) { |
| 531 |
|
throw new UnauthorizedException('content', 'hide'); |
| 532 |
|
} |
| 533 |
|
|
| 534 |
|
$this->repository->beginTransaction(); |
| 535 |
|
try { |
| 536 |
|
$this->persistenceHandler->locationHandler()->hide($location->id); |
| 537 |
|
$this->repository->commit(); |
| 538 |
|
} catch (Exception $e) { |
| 539 |
|
$this->repository->rollback(); |
| 540 |
|
throw $e; |
| 541 |
|
} |
| 542 |
|
|
| 543 |
|
return $this->loadLocation($location->id); |
| 544 |
|
} |
| 545 |
|
|
| 546 |
|
/** |
| 547 |
|
* Unhides the $location. |
|
@@ 558-574 (lines=17) @@
|
| 555 |
|
* |
| 556 |
|
* @return \eZ\Publish\API\Repository\Values\Content\Location $location, with updated hidden value |
| 557 |
|
*/ |
| 558 |
|
public function unhideLocation(APILocation $location) |
| 559 |
|
{ |
| 560 |
|
if (!$this->repository->canUser('content', 'hide', $location->getContentInfo(), $location)) { |
| 561 |
|
throw new UnauthorizedException('content', 'hide'); |
| 562 |
|
} |
| 563 |
|
|
| 564 |
|
$this->repository->beginTransaction(); |
| 565 |
|
try { |
| 566 |
|
$this->persistenceHandler->locationHandler()->unHide($location->id); |
| 567 |
|
$this->repository->commit(); |
| 568 |
|
} catch (Exception $e) { |
| 569 |
|
$this->repository->rollback(); |
| 570 |
|
throw $e; |
| 571 |
|
} |
| 572 |
|
|
| 573 |
|
return $this->loadLocation($location->id); |
| 574 |
|
} |
| 575 |
|
|
| 576 |
|
/** |
| 577 |
|
* Moves the subtree to $newParentLocation. |