src/Graviton/FileBundle/Controller/FileController.php
public function patchAction($id, Request $request)
    {
        // Update modified date
        $content = json_decode($request->getContent(), true);
        if ($content) {
            // Checking so update time is correct
            $now = new \DateTime();
            $patch = [
                'op' => 'replace',
                'path' => '/metadata/modificationDate',
                'value' => $now->format(DATE_ISO8601)
            ];
            // It can be a simple patch or a multi array patching.
            if (array_key_exists(0, $content)) {
                $content[] = $patch;
            } else {
                $content = [$content, $patch];
            }

            $request = new Request(
                $request->query->all(),
                $request->request->all(),
                $request->attributes->all(),
                $request->cookies->all(),
                $request->files->all(),
                $request->server->all(),
                json_encode($content)
            );
        }

        return parent::patchAction($id, $request);
    }
public function patchAction($id, Request $request)
    {
        // Update modified date
        $content = json_decode($request->getContent(), true);
        if ($content) {
            // Checking so update time is correct
            $now = new \DateTime();
            $patch = [
                'op' => 'replace',
                'path' => '/metadata/modificationDate',
                'value' => $now->format(DATE_ISO8601)
            ];
            // It can be a simple patch or a multi array patching.
            if (array_key_exists(0, $content)) {
                $content[] = $patch;
            } else {
                $content = [$content, $patch];
            }

            $request = new Request(
                $request->query->all(),
                $request->request->all(),
                $request->attributes->all(),
                $request->cookies->all(),
                $request->files->all(),
                $request->server->all(),
                json_encode($content)
            );
        }

        return parent::patchAction($id, $request);
    }
public function patchAction ( $ id , Request $ request ) { // Update modified date $ content = json_decode ( $ request -> getContent ( ) , true ) ; if ( $ content ) { // Checking so update time is correct $ now = new \ DateTime ( ) ; $ patch = [ 'op' => 'replace' , 'path' => '/metadata/modificationDate' , 'value' => $ now -> format ( DATE_ISO8601 ) ] ; // It can be a simple patch or a multi array patching. if ( array_key_exists ( 0 , $ content ) ) { $ content [ ] = $ patch ; } else { $ content = [ $ content , $ patch ] ; } $ request = new Request ( $ request -> query -> all ( ) , $ request -> request -> all ( ) , $ request -> attributes -> all ( ) , $ request -> cookies -> all ( ) , $ request -> files -> all ( ) , $ request -> server -> all ( ) , json_encode ( $ content ) ) ; } return parent :: patchAction ( $ id , $ request ) ; }
Patch a record, we add here a patch on Modification Data.

@param Number  $id      ID of record
@param Request $request Current http request

@throws MalformedInputException

@return Response $response Result of action with data (if successful)
Patch a record we add here a patch on Modification Data .