private function executeRevert(AbstractClassContent $content, Revision $draft, array $data)
    {
        $content->setDraft(null);
        if ($content instanceof ContentSet) {
            if (isset($data['elements']) && true === $data['elements']) {
                $draft->clear();
                foreach ($content->getData() as $element) {
                    if ($element instanceof AbstractClassContent) {
                        $draft->push($element);
                    }
                }
            }
        } else {
            foreach ($content->getData() as $key => $element) {
                if (isset($data['elements']) && in_array($key, $data['elements'])) {
                    $draft->$key = $content->$key;
                }

                if (in_array('Element\Keyword', $content->getAccept()[$key])) {
                    $this->entityManager
                        ->getRepository('BackBee\ClassContent\Element\Keyword')
                        ->cleanKeywordLinks($content, $element);
                }
            }
        }

        if (isset($data['parameters'])) {
            foreach ($content->getDefaultParams() as $key => $params) {
                if (in_array($key, $data['parameters'])) {
                    $draft->setParam($key, $content->getParamValue($key));
                }
            }
        }

        return $this;
    }
private function executeRevert(AbstractClassContent $content, Revision $draft, array $data)
    {
        $content->setDraft(null);
        if ($content instanceof ContentSet) {
            if (isset($data['elements']) && true === $data['elements']) {
                $draft->clear();
                foreach ($content->getData() as $element) {
                    if ($element instanceof AbstractClassContent) {
                        $draft->push($element);
                    }
                }
            }
        } else {
            foreach ($content->getData() as $key => $element) {
                if (isset($data['elements']) && in_array($key, $data['elements'])) {
                    $draft->$key = $content->$key;
                }

                if (in_array('Element\Keyword', $content->getAccept()[$key])) {
                    $this->entityManager
                        ->getRepository('BackBee\ClassContent\Element\Keyword')
                        ->cleanKeywordLinks($content, $element);
                }
            }
        }

        if (isset($data['parameters'])) {
            foreach ($content->getDefaultParams() as $key => $params) {
                if (in_array($key, $data['parameters'])) {
                    $draft->setParam($key, $content->getParamValue($key));
                }
            }
        }

        return $this;
    }
private function executeRevert ( AbstractClassContent $ content , Revision $ draft , array $ data ) { $ content -> setDraft ( null ) ; if ( $ content instanceof ContentSet ) { if ( isset ( $ data [ 'elements' ] ) && true === $ data [ 'elements' ] ) { $ draft -> clear ( ) ; foreach ( $ content -> getData ( ) as $ element ) { if ( $ element instanceof AbstractClassContent ) { $ draft -> push ( $ element ) ; } } } } else { foreach ( $ content -> getData ( ) as $ key => $ element ) { if ( isset ( $ data [ 'elements' ] ) && in_array ( $ key , $ data [ 'elements' ] ) ) { $ draft -> $ key = $ content -> $ key ; } if ( in_array ( 'Element\Keyword' , $ content -> getAccept ( ) [ $ key ] ) ) { $ this -> entityManager -> getRepository ( 'BackBee\ClassContent\Element\Keyword' ) -> cleanKeywordLinks ( $ content , $ element ) ; } } } if ( isset ( $ data [ 'parameters' ] ) ) { foreach ( $ content -> getDefaultParams ( ) as $ key => $ params ) { if ( in_array ( $ key , $ data [ 'parameters' ] ) ) { $ draft -> setParam ( $ key , $ content -> getParamValue ( $ key ) ) ; } } } return $ this ; }
Executes revert action on content and its draft.

@param  AbstractClassContent $content
@param  Revision             $draft
@param  array                $data

@return ClassContentManager
Executes revert action on content and its draft .