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
969872
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());
    }
189038
def remove_content_history_in_cloud(self, page_id, version_id):
        
        url = 'rest/api/content/{id}/version/{versionId}'.format(id=page_id, versionId=version_id)
        self.delete(url)
673018
public function loadContentVersions($contentId, Request $request)
    {
        $contentInfo = $this->repository->getContentService()->loadContentInfo($contentId);

        return new Values\VersionList(
            $this->repository->getContentService()->loadVersions($contentInfo),
            $request->getPathInfo()
        );
    }
107092
public function cancelContentId($contentId)
    {
        $params = array();
        $params['action'] = 'cancleContentIdAction';
        $params['appkey'] = $this->appkey;
        $params['contentId'] = $contentId;
        $rep = $this->httpPostJSON($this->host, $params);
        return (string)$rep['result'] === 'ok';
    }
809127
public static String generateNextRevisionId(String revisionId) {
        validateRevisionId(revisionId);
        int generation = generationFromRevId(revisionId);
        String digest = createUUID();
        return Integer.toString(generation + 1) + "-" + digest;
    }
346820
public function removeUsedHint($hintId)
    {
        $pos = array_search($hintId, $this->usedHints);
        if (false !== $pos) {
            array_splice($this->usedHints, $pos, 1);
        }
    }
1056115
public function detach($contentId, $blockTypeId)
    {
        try {
            $this->contentBlocks->detach($contentId, $blockTypeId);
        } catch (Exception $e) {
            return $this->handleException($e, trans('soda::errors.detach', ['object' => trans('soda::terminology.block')]));
        }

        return redirect()->route('soda.content.edit', $contentId)->with('success', trans('soda::messages.detached', ['object' => trans('soda::terminology.block')]));
    }
967285
public function get($fileId, $revisionId, $optParams = array()) {
      $params = array('fileId' => $fileId, 'revisionId' => $revisionId);
      $params = array_merge($params, $optParams);
      $data = $this->__call('get', array($params));
      if ($this->useObjects()) {
        return new Revision($data);
      } else {
        return $data;
      }
    }
1195065
public function duplicateContent(ContentInterface $content, $contentId = null)
    {
        $newContent = $this->cloneContent($content);
        $newContent->setContentId($contentId);
        $newContent->setName($this->duplicateLabel($content->getName()));
        $newContent = $this->setVersionName($newContent);

        return $newContent;
    }
148931
private function deleteTranslationFromContentObject($contentId, $languageId)
    {
        $query = $this->connection->createQueryBuilder();
        $query->update('ezcontentobject')
            // parameter for bitwise operation has to be placed verbatim (w/o binding) for this to work cross-DBMS
            ->set('language_mask', 'language_mask & ~ ' . $languageId)
            ->set('modified', ':now')
            ->where('id = :contentId')
            ->andWhere(
            // make sure removed translation is not the last one (incl. alwaysAvailable)
                $query->expr()->andX(
                    'language_mask & ~ ' . $languageId . ' <> 0',
                    'language_mask & ~ ' . $languageId . ' <> 1'
                )
            )
            ->setParameter(':now', time())
            ->setParameter(':contentId', $contentId)
        ;

        $rowCount = $query->execute();

        // no rows updated means that most likely somehow it was the last remaining translation
        if ($rowCount === 0) {
            throw new BadStateException(
                '$languageCode',
                'Specified translation is the only one Content Object Version has'
            );
        }
    }
840056
public function delete($id = null) {
        $this->request->allowMethod(['post', 'delete']);
        $this->CmsContent = TableRegistry::get('CmsContent');
        $cmsContent = $this->CmsContent->get($id);
        if ($this->CmsContent->delete($cmsContent)) {
            $this->Flash->success('The cms content has been deleted.');
        } else {
            $this->Flash->error('The cms content could not be deleted. Please, try again.');
        }
        return $this->redirect(['action' => 'index']);
    }
704344
protected function deleteRelatedContent($id = NULL) {
        $this->CmsContent = TableRegistry::get('CmsContent');
        $content = $this->CmsContent->get($id);
        if (trim($content->content_path) != '')
            $this->_removeFile($content->content_path);
        return $this->CmsContent->delete($content);
    }
465485
public function deleteSection($sectionId)
    {
        $this->sectionService->deleteSection(
            $this->sectionService->loadSection($sectionId)
        );

        return new NoContent();
    }
448687
public function removeCustomAlias($nodeId, $siteId)
    {
        $this
            ->database
            ->update('ucms_seo_route')
            ->condition('node_id', $nodeId)
            ->condition('site_id', $siteId)
            ->fields(['is_protected' => 0, 'is_outdated' => 1])
            ->execute()
        ;
    }
934799
public function deleteNames($contentId, $versionNo = null)
    {
        $query = $this->dbHandler->createDeleteQuery();
        $query->deleteFrom('ezcontentobject_name')
            ->where(
                $query->expr->eq(
                    $this->dbHandler->quoteColumn('contentobject_id'),
                    $query->bindValue($contentId, null, \PDO::PARAM_INT)
                )
            );

        if (isset($versionNo)) {
            $query->where(
                $query->expr->eq(
                    $this->dbHandler->quoteColumn('content_version'),
                    $query->bindValue($versionNo, null, \PDO::PARAM_INT)
                )
            );
        }

        $query->prepare()->execute();
    }
775421
public function deleteRevision($clear = true)
    {
        $this->getFieldTypes()->each(function ($type) {
            $type::where('revision_id', $this->revision->id)->delete();
        });

        // If this revision is currently
        // published, we need to publish
        // another revision in place.
        if ($this->revision->published && $this->revision->exists) {
            //TODO :: improve this logic
            Revision::where('content_id', $this->content->id)
                ->where('id', '!=', $this->revision->id)
                ->take(1)
                ->update(['published' => true]);
        }

        $this->revision->delete();

        if ($clear) {
            $this->clearFields();
        }
    }
1037202
public function removeRevisionEntity(\ZF\Doctrine\Audit\Entity\RevisionEntity $revisionEntity)
    {
        $this->revisionEntity->removeElement($revisionEntity);
    }