src/Controller/TypeController.php
public function edit(ServerRequestInterface $request)
    {
        if ($this->isReadOnly()) {
            return new NotFoundStatusResponse();
        }

        if ($this->active_object && $this->active_object->isLoaded()) {
            $authenticated_user = $this->getAuthenticatedUser($request);

            if ($this->shouldCheckPermissions() && !$this->canEdit($this->active_object, $authenticated_user)) {
                return new ForbiddenStatusResponse();
            }

            $request_body = $request->getParsedBody();

            if (empty($request_body)) {
                $request_body = [];
            }

            if ($this->requestBodyContainsProtectedFields($this->active_object, $request_body)) {
                return new BadRequestStatusResponse();
            }

            $this->cleanUpRequestBodyForEdit($request_body, $authenticated_user);

            try {
                return $this->pool->modify($this->active_object, $request_body);
            } catch (ValidationException $e) {
                return $e;
            }
        } else {
            return new NotFoundStatusResponse();
        }
    }
public function edit(ServerRequestInterface $request)
    {
        if ($this->isReadOnly()) {
            return new NotFoundStatusResponse();
        }

        if ($this->active_object && $this->active_object->isLoaded()) {
            $authenticated_user = $this->getAuthenticatedUser($request);

            if ($this->shouldCheckPermissions() && !$this->canEdit($this->active_object, $authenticated_user)) {
                return new ForbiddenStatusResponse();
            }

            $request_body = $request->getParsedBody();

            if (empty($request_body)) {
                $request_body = [];
            }

            if ($this->requestBodyContainsProtectedFields($this->active_object, $request_body)) {
                return new BadRequestStatusResponse();
            }

            $this->cleanUpRequestBodyForEdit($request_body, $authenticated_user);

            try {
                return $this->pool->modify($this->active_object, $request_body);
            } catch (ValidationException $e) {
                return $e;
            }
        } else {
            return new NotFoundStatusResponse();
        }
    }
public function edit ( ServerRequestInterface $ request ) { if ( $ this -> isReadOnly ( ) ) { return new NotFoundStatusResponse ( ) ; } if ( $ this -> active_object && $ this -> active_object -> isLoaded ( ) ) { $ authenticated_user = $ this -> getAuthenticatedUser ( $ request ) ; if ( $ this -> shouldCheckPermissions ( ) && ! $ this -> canEdit ( $ this -> active_object , $ authenticated_user ) ) { return new ForbiddenStatusResponse ( ) ; } $ request_body = $ request -> getParsedBody ( ) ; if ( empty ( $ request_body ) ) { $ request_body = [ ] ; } if ( $ this -> requestBodyContainsProtectedFields ( $ this -> active_object , $ request_body ) ) { return new BadRequestStatusResponse ( ) ; } $ this -> cleanUpRequestBodyForEdit ( $ request_body , $ authenticated_user ) ; try { return $ this -> pool -> modify ( $ this -> active_object , $ request_body ) ; } catch ( ValidationException $ e ) { return $ e ; } } else { return new NotFoundStatusResponse ( ) ; } }
Update an existing type instance.

@param  ServerRequestInterface $request
@return EntityInterface
Update an existing type instance .