private function updateClassContentDraft($type, $uid, $data)
    {
        $this->granted('VIEW', $content = $this->getClassContentByTypeAndUid($type, $uid));
        $this->granted('EDIT', $content);

        $operation = $data['operation'];
        if (!in_array($operation, ['commit', 'revert'])) {
            throw new BadRequestHttpException(sprintf('%s is not a valid operation for update draft.', $operation));
        }

        $this->getClassContentManager()->$operation($content, $data);

        return $content;
    }
private function updateClassContentDraft($type, $uid, $data)
    {
        $this->granted('VIEW', $content = $this->getClassContentByTypeAndUid($type, $uid));
        $this->granted('EDIT', $content);

        $operation = $data['operation'];
        if (!in_array($operation, ['commit', 'revert'])) {
            throw new BadRequestHttpException(sprintf('%s is not a valid operation for update draft.', $operation));
        }

        $this->getClassContentManager()->$operation($content, $data);

        return $content;
    }
private function updateClassContentDraft ( $ type , $ uid , $ data ) { $ this -> granted ( 'VIEW' , $ content = $ this -> getClassContentByTypeAndUid ( $ type , $ uid ) ) ; $ this -> granted ( 'EDIT' , $ content ) ; $ operation = $ data [ 'operation' ] ; if ( ! in_array ( $ operation , [ 'commit' , 'revert' ] ) ) { throw new BadRequestHttpException ( sprintf ( '%s is not a valid operation for update draft.' , $ operation ) ) ; } $ this -> getClassContentManager ( ) -> $ operation ( $ content , $ data ) ; return $ content ; }
Commits or reverts content's draft according to provided data.

@param string $type
@param string $uid
@param array  $data

@return AbstractClassContent
Commits or reverts content s draft according to provided data .