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

        $imageInstance = $this->updateFileAction($imageId, $parentType, 'image', TheliaEvents::IMAGE_UPDATE);

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

        $imageInstance = $this->updateFileAction($imageId, $parentType, 'image', TheliaEvents::IMAGE_UPDATE);

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

@param int    $imageId    Parent id owning images being saved
@param string $parentType Parent Type owning images being saved

@return Response
Manage how an image is updated