src/Graviton/RestBundle/Service/RestUtils.php
public function checkJsonPatchRequest(array $jsonPatch)
    {
        foreach ($jsonPatch as $operation) {
            if (!is_array($operation)) {
                throw new InvalidJsonPatchException('Patch request should be an array of operations.');
            }
            if (array_key_exists('path', $operation) && trim($operation['path']) == '/id') {
                throw new InvalidJsonPatchException('Change/remove of ID not allowed');
            }
        }
    }
public function checkJsonPatchRequest(array $jsonPatch)
    {
        foreach ($jsonPatch as $operation) {
            if (!is_array($operation)) {
                throw new InvalidJsonPatchException('Patch request should be an array of operations.');
            }
            if (array_key_exists('path', $operation) && trim($operation['path']) == '/id') {
                throw new InvalidJsonPatchException('Change/remove of ID not allowed');
            }
        }
    }
public function checkJsonPatchRequest ( array $ jsonPatch ) { foreach ( $ jsonPatch as $ operation ) { if ( ! is_array ( $ operation ) ) { throw new InvalidJsonPatchException ( 'Patch request should be an array of operations.' ) ; } if ( array_key_exists ( 'path' , $ operation ) && trim ( $ operation [ 'path' ] ) == '/id' ) { throw new InvalidJsonPatchException ( 'Change/remove of ID not allowed' ) ; } } }
Validate JSON patch for any object

@param array $jsonPatch json patch as array

@throws InvalidJsonPatchException
@return void
Validate JSON patch for any object