eZ\Publish\Core\SignalSlot\TrashService::recover PHP Method

recover() public method

Recovers the $trashedLocation at its original place if possible.
public recover ( eZ\Publish\API\Repository\Values\Content\TrashItem $trashItem, eZ\Publish\API\Repository\Values\Content\Location $newParentLocation = null ) : eZ\Publish\API\Repository\Values\Content\Location
$trashItem eZ\Publish\API\Repository\Values\Content\TrashItem
$newParentLocation eZ\Publish\API\Repository\Values\Content\Location
return eZ\Publish\API\Repository\Values\Content\Location the newly created or recovered location
    public function recover(TrashItem $trashItem, Location $newParentLocation = null)
    {
        $newLocation = $this->service->recover($trashItem, $newParentLocation);
        $this->signalDispatcher->emit(new RecoverSignal(array('trashItemId' => $trashItem->id, 'contentId' => $trashItem->contentId, 'newParentLocationId' => $newParentLocation !== null ? $newParentLocation->id : null, 'newLocationId' => $newLocation->id)));
        return $newLocation;
    }