protected function _beforeEntityUpdate(AnCommandContext $context)
    {
        $modifications = $this->getModifiedData();

        if (isset($this->__restored)) {
            return;
        }

        if (
              $modifications->name ||
              $modifications->body ||
              $modifications->excerpt
        ) {
            $revision = $this->addNewRevision();

            foreach ($modifications as $property => $change) {
                $revision->$property = $change->old;
            }
        }
    }
protected function _beforeEntityUpdate(AnCommandContext $context)
    {
        $modifications = $this->getModifiedData();

        if (isset($this->__restored)) {
            return;
        }

        if (
              $modifications->name ||
              $modifications->body ||
              $modifications->excerpt
        ) {
            $revision = $this->addNewRevision();

            foreach ($modifications as $property => $change) {
                $revision->$property = $change->old;
            }
        }
    }
protected function _beforeEntityUpdate ( AnCommandContext $ context ) { $ modifications = $ this -> getModifiedData ( ) ; if ( isset ( $ this -> __restored ) ) { return ; } if ( $ modifications -> name || $ modifications -> body || $ modifications -> excerpt ) { $ revision = $ this -> addNewRevision ( ) ; foreach ( $ modifications as $ property => $ change ) { $ revision -> $ property = $ change -> old ; } } }
Creates a new revision before updating.
Creates a new revision before updating .