public function deleteRevision($contentId, $revisionId)
    {
        $this->loadModel('Content.ContentRevisions');
        $revision = $this->ContentRevisions->find()
            ->where(['id' => $revisionId, 'content_id' => $contentId])
            ->first();

        if ($this->ContentRevisions->delete($revision, ['atomic' => true])) {
            $this->Flash->success(__d('content', 'Revision was successfully removed!'));
        } else {
            $this->Flash->danger(__d('content', 'Unable to remove this revision, please try again.'));
        }

        $this->title(__d('content', 'Editing Content Revision'));
        $this->redirect($this->referer());
    }
public function deleteRevision($contentId, $revisionId)
    {
        $this->loadModel('Content.ContentRevisions');
        $revision = $this->ContentRevisions->find()
            ->where(['id' => $revisionId, 'content_id' => $contentId])
            ->first();

        if ($this->ContentRevisions->delete($revision, ['atomic' => true])) {
            $this->Flash->success(__d('content', 'Revision was successfully removed!'));
        } else {
            $this->Flash->danger(__d('content', 'Unable to remove this revision, please try again.'));
        }

        $this->title(__d('content', 'Editing Content Revision'));
        $this->redirect($this->referer());
    }
public function deleteRevision ( $ contentId , $ revisionId ) { $ this -> loadModel ( 'Content.ContentRevisions' ) ; $ revision = $ this -> ContentRevisions -> find ( ) -> where ( [ 'id' => $ revisionId , 'content_id' => $ contentId ] ) -> first ( ) ; if ( $ this -> ContentRevisions -> delete ( $ revision , [ 'atomic' => true ] ) ) { $ this -> Flash -> success ( __d ( 'content' , 'Revision was successfully removed!' ) ) ; } else { $ this -> Flash -> danger ( __d ( 'content' , 'Unable to remove this revision, please try again.' ) ) ; } $ this -> title ( __d ( 'content' , 'Editing Content Revision' ) ) ; $ this -> redirect ( $ this -> referer ( ) ) ; }
Removes the given revision of the given content.

@param int $contentId Content's ID
@param int $revisionId Revision's ID
@return void Redirects to previous page
Removes the given revision of the given content .