public function revert(AbstractClassContent $content, array $data = [])
    {
        if (0 === count($data)) {
            $data['parameters'] = array_keys($content->getAllParams());
            if ($content instanceof ContentSet) {
                $data['elements'] = true;
            } else {
                $data['elements'] = array_keys($content->getData());
            }
        }

        if (!isset($data['parameters']) && !isset($data['elements'])) {
            throw new \InvalidArgumentException('Provided data are not valids for ClassContentManager::revert.');
        }

        if (null === $draft = $this->getDraft($content)) {
            throw new InvalidArgumentException(sprintf(
                '%s with identifier "%s" has not draft, nothing to revert.',
                $content->getContentType(),
                $content->getUid()
            ));
        }

        $this->executeRevert($content, $draft, $data);
        $this->revertPostProcess($content, $draft);

        return $this;
    }
public function revert(AbstractClassContent $content, array $data = [])
    {
        if (0 === count($data)) {
            $data['parameters'] = array_keys($content->getAllParams());
            if ($content instanceof ContentSet) {
                $data['elements'] = true;
            } else {
                $data['elements'] = array_keys($content->getData());
            }
        }

        if (!isset($data['parameters']) && !isset($data['elements'])) {
            throw new \InvalidArgumentException('Provided data are not valids for ClassContentManager::revert.');
        }

        if (null === $draft = $this->getDraft($content)) {
            throw new InvalidArgumentException(sprintf(
                '%s with identifier "%s" has not draft, nothing to revert.',
                $content->getContentType(),
                $content->getUid()
            ));
        }

        $this->executeRevert($content, $draft, $data);
        $this->revertPostProcess($content, $draft);

        return $this;
    }
public function revert ( AbstractClassContent $ content , array $ data = [ ] ) { if ( 0 === count ( $ data ) ) { $ data [ 'parameters' ] = array_keys ( $ content -> getAllParams ( ) ) ; if ( $ content instanceof ContentSet ) { $ data [ 'elements' ] = true ; } else { $ data [ 'elements' ] = array_keys ( $ content -> getData ( ) ) ; } } if ( ! isset ( $ data [ 'parameters' ] ) && ! isset ( $ data [ 'elements' ] ) ) { throw new \ InvalidArgumentException ( 'Provided data are not valids for ClassContentManager::revert.' ) ; } if ( null === $ draft = $ this -> getDraft ( $ content ) ) { throw new InvalidArgumentException ( sprintf ( '%s with identifier "%s" has not draft, nothing to revert.' , $ content -> getContentType ( ) , $ content -> getUid ( ) ) ) ; } $ this -> executeRevert ( $ content , $ draft , $ data ) ; $ this -> revertPostProcess ( $ content , $ draft ) ; return $ this ; }
Computes provided data to define what to revert from given content.

@param  AbstractClassContent $content
@param  array                $data

@return ClassContentManager
Computes provided data to define what to revert from given content .