eZ\Publish\Core\Persistence\Legacy\Content\Location\Gateway\DoctrineDatabase::untrashLocation PHP Method

untrashLocation() public method

Recreates the originally trashed location in the new position. If no new position has been specified, it will be tried to re-create the location at the old position. If this is not possible ( because the old location does not exist any more) and exception is thrown.
public untrashLocation ( mixed $locationId, mixed | null $newParentId = null ) : eZ\Publish\SPI\Persistence\Content\Location
$locationId mixed
$newParentId mixed | null
return eZ\Publish\SPI\Persistence\Content\Location
    public function untrashLocation($locationId, $newParentId = null)
    {
        $row = $this->loadTrashByLocation($locationId);
        $newLocation = $this->create(new CreateStruct(array('priority' => $row['priority'], 'hidden' => $row['is_hidden'], 'invisible' => $row['is_invisible'], 'remoteId' => $row['remote_id'], 'contentId' => $row['contentobject_id'], 'contentVersion' => $row['contentobject_version'], 'mainLocationId' => true, 'sortField' => $row['sort_field'], 'sortOrder' => $row['sort_order'])), $this->getBasicNodeData($newParentId ?: $row['parent_node_id']));
        $this->removeElementFromTrash($locationId);
        $this->setContentStatus($row['contentobject_id'], ContentInfo::STATUS_PUBLISHED);
        return $newLocation;
    }