DNRoot::transfer PHP Method

transfer() public method

View into the log for a {@link DNDataTransfer}.
public transfer ( SS_HTTPRequest $request ) : SS_HTTPResponse | string
$request SS_HTTPRequest
return SS_HTTPResponse | string
    public function transfer(\SS_HTTPRequest $request)
    {
        $this->setCurrentActionType(self::ACTION_SNAPSHOT);
        $params = $request->params();
        $transfer = DNDataTransfer::get()->byId($params['Identifier']);
        if (!$transfer || !$transfer->ID) {
            throw new SS_HTTPResponse_Exception('Transfer not found', 404);
        }
        if (!$transfer->canView()) {
            return Security::permissionFailure();
        }
        $environment = $transfer->Environment();
        $project = $environment->Project();
        if ($project->Name != $params['Project']) {
            throw new LogicException("Project in URL doesn't match this deploy");
        }
        return $this->render(['CurrentTransfer' => $transfer, 'SnapshotsSection' => 1]);
    }