private function revertPostProcess(AbstractClassContent $content, Revision $draft)
    {
        $data = $draft->jsonSerialize();

        if (
            0 === count($data['parameters'])
            && (
                0 === count($data['elements'])
                || (
                    $content instanceof ContentSet
                    && $data['elements']['current'] === $data['elements']['draft']
                )
            )
        ) {
            if ($content instanceof ContentSet) {
                $draft->clear();
            }

            if (AbstractClassContent::STATE_NEW === $content->getState()) {
                $classname = AbstractClassContent::getClassnameByContentType($content->getContentType());
                $this->entityManager->getRepository($classname)->deleteContent($content);
            } else {
                $this->entityManager->remove($draft);
            }
        }

        return $this;
    }
private function revertPostProcess(AbstractClassContent $content, Revision $draft)
    {
        $data = $draft->jsonSerialize();

        if (
            0 === count($data['parameters'])
            && (
                0 === count($data['elements'])
                || (
                    $content instanceof ContentSet
                    && $data['elements']['current'] === $data['elements']['draft']
                )
            )
        ) {
            if ($content instanceof ContentSet) {
                $draft->clear();
            }

            if (AbstractClassContent::STATE_NEW === $content->getState()) {
                $classname = AbstractClassContent::getClassnameByContentType($content->getContentType());
                $this->entityManager->getRepository($classname)->deleteContent($content);
            } else {
                $this->entityManager->remove($draft);
            }
        }

        return $this;
    }
private function revertPostProcess ( AbstractClassContent $ content , Revision $ draft ) { $ data = $ draft -> jsonSerialize ( ) ; if ( 0 === count ( $ data [ 'parameters' ] ) && ( 0 === count ( $ data [ 'elements' ] ) || ( $ content instanceof ContentSet && $ data [ 'elements' ] [ 'current' ] === $ data [ 'elements' ] [ 'draft' ] ) ) ) { if ( $ content instanceof ContentSet ) { $ draft -> clear ( ) ; } if ( AbstractClassContent :: STATE_NEW === $ content -> getState ( ) ) { $ classname = AbstractClassContent :: getClassnameByContentType ( $ content -> getContentType ( ) ) ; $ this -> entityManager -> getRepository ( $ classname ) -> deleteContent ( $ content ) ; } else { $ this -> entityManager -> remove ( $ draft ) ; } } return $ this ; }
Runs revert post action on content and its draft.

@param  AbstractClassContent $content
@param  Revision             $draft

@return ClassContentManager
Runs revert post action on content and its draft .