public function updateDocumentAction($documentId, $parentType)
    {
        if (null !== $response = $this->checkAuth($this->getAdminResources()->getResource($parentType, static::MODULE_RIGHT), array(), AccessManager::UPDATE)) {
            return $response;
        }

        $documentInstance = $this->updateFileAction($documentId, $parentType, 'document', TheliaEvents::DOCUMENT_UPDATE);

        if ($documentInstance instanceof \Symfony\Component\HttpFoundation\Response) {
            return $documentInstance;
        } else {
            return $this->render('document-edit', array(
                'documentId' => $documentId,
                'documentType' => $parentType,
                'redirectUrl' => $documentInstance->getRedirectionUrl(),
                'formId' => $documentInstance->getUpdateFormId()
            ));
        }
    }
public function updateDocumentAction($documentId, $parentType)
    {
        if (null !== $response = $this->checkAuth($this->getAdminResources()->getResource($parentType, static::MODULE_RIGHT), array(), AccessManager::UPDATE)) {
            return $response;
        }

        $documentInstance = $this->updateFileAction($documentId, $parentType, 'document', TheliaEvents::DOCUMENT_UPDATE);

        if ($documentInstance instanceof \Symfony\Component\HttpFoundation\Response) {
            return $documentInstance;
        } else {
            return $this->render('document-edit', array(
                'documentId' => $documentId,
                'documentType' => $parentType,
                'redirectUrl' => $documentInstance->getRedirectionUrl(),
                'formId' => $documentInstance->getUpdateFormId()
            ));
        }
    }
public function updateDocumentAction ( $ documentId , $ parentType ) { if ( null !== $ response = $ this -> checkAuth ( $ this -> getAdminResources ( ) -> getResource ( $ parentType , static :: MODULE_RIGHT ) , array ( ) , AccessManager :: UPDATE ) ) { return $ response ; } $ documentInstance = $ this -> updateFileAction ( $ documentId , $ parentType , 'document' , TheliaEvents :: DOCUMENT_UPDATE ) ; if ( $ documentInstance instanceof \ Symfony \ Component \ HttpFoundation \ Response ) { return $ documentInstance ; } else { return $ this -> render ( 'document-edit' , array ( 'documentId' => $ documentId , 'documentType' => $ parentType , 'redirectUrl' => $ documentInstance -> getRedirectionUrl ( ) , 'formId' => $ documentInstance -> getUpdateFormId ( ) ) ) ; } }
Manage how an document is updated

@param int    $documentId Parent id owning documents being saved
@param string $parentType Parent Type owning documents being saved

@return Response
Manage how an document is updated