Delete an old version of a document.

@param string $documentVersion the version name
427138
public function removeVersion($documentVersion)
    {
        $oid = spl_object_hash($documentVersion);
        $history = $this->documentHistory[$oid];
        $version = $this->documentVersion[$oid];

        $history->removeVersion($version->getName());

        unset($this->documentVersion[$oid], $this->documentHistory[$oid]);
    }
1037068
public function removeTranslation($document, $locale)
    {
        $class = $this->dm->getClassMetadata(get_class($document));
        if ($invoke = $this->eventListenersInvoker->getSubscribedSystems($class, Event::preRemoveTranslation)) {
            $this->eventListenersInvoker->invoke(
                $class,
                Event::preRemoveTranslation,
                $document,
                new LifecycleEventArgs($document, $this->dm),
                $invoke
            );
        }

        $metadata = $this->dm->getClassMetadata(get_class($document));
        if (!$this->isDocumentTranslatable($metadata)) {
            return;
        }

        if (1 === count($this->getLocalesFor($document))) {
            throw new PHPCRException('The last translation of a translatable document may not be removed');
        }

        if ($document instanceof Proxy) {
            $document->__load();
        }

        $oid = spl_object_hash($document);
        $this->documentTranslations[$oid][$locale] = null;
        $this->setLocale($document, $metadata, null);
    }
139492
function deleteStoredClassAttribute( $contentClassAttribute, $version = null )
    {
        $contentClassAttributeID = $contentClassAttribute->attribute( 'id' );
        eZEnumValue::removeAllElements( $contentClassAttributeID, $version );

    }
511349
public function deleteTranslationFromVersionFields(VersionInfo $versionInfo, $languageCode)
    {
        $fieldTypeIdsMap = $this->contentGateway->getFieldIdsByType(
            $versionInfo->contentInfo->id,
            $versionInfo->versionNo,
            $languageCode
        );
        foreach ($fieldTypeIdsMap as $fieldType => $ids) {
            $this->storageHandler->deleteFieldData($fieldType, $versionInfo, $ids);
        }
        $this->contentGateway->deleteTranslatedFields(
            $languageCode,
            $versionInfo->contentInfo->id,
            $versionInfo->versionNo
        );
    }
377968
public function deleteVersionAction(Request $request, $id, $version)
    {
        $locale = $this->getRequestParameter($request, 'locale', true);
        $mediaManager = $this->getMediaManager();
        $media = $mediaManager->getById($id, $locale);

        if ($media->getVersion() === (int) $version) {
            throw new BadRequestHttpException('Can\'t delete active version of a media.');
        }

        $currentFileVersion = null;

        /** @var Media $mediaEntity */
        foreach ($media->getFile()->getFileVersions() as $fileVersion) {
            if ($fileVersion->getVersion() === (int) $version) {
                $currentFileVersion = $fileVersion;
                break;
            }
        }

        if (!$currentFileVersion) {
            throw new NotFoundHttpException(sprintf(
                'Version "%s" for Media "%s"',
                $version,
                $id
            ));
        }

        $entityManager = $this->get('doctrine.orm.entity_manager');
        $entityManager->remove($currentFileVersion);
        $entityManager->flush();
        // After successfully delete in the database remove file from storage
        $this->get('sulu_media.storage')->remove($currentFileVersion->getStorageOptions());

        return new Response('', 204);
    }
1130783
public function setVersion($version)
    {
        if (!in_array($version, $this->supportedVersions)) {
            $this->throwError('The version ' . $version . ' is not supported by this library');
        }

        $this->version = $version;

        return $this;
    }
1052830
protected function setVersion($version) {
		$this->version = $version;

		$numbers = explode('.', $version);

		// Update Mayor and Minor-Version-Numbers
		$this->setMayor((int) $numbers[0]);
		$this->setMinor((int) $numbers[1]);
	}
262896
public function deleteStoredObjectAttribute( $contentObjectAttribute, $version = null )
    {
        $contentObjectAttributeID = $contentObjectAttribute->attribute( 'id' );
        eZTagsAttributeLinkObject::removeByAttribute( $contentObjectAttributeID, $version );
    }
765878
public function setCurrentVersion($version)
    {
        $version = min($this->getMaxVersion(), $version);
        $version = max($version, 0);
        $this->_getVersion()->version = $version;
        $this->_getVersion()->saveEntity();
    }
1172462
static public function removeByAttribute( $objectAttributeID, $objectAttributeVersion = null )
    {
        if ( !is_numeric( $objectAttributeID ) )
            return;

        $conditions = array( 'objectattribute_id' => (int) $objectAttributeID );
        if ( is_numeric( $objectAttributeVersion ) )
            $conditions['objectattribute_version'] = (int) $objectAttributeVersion;

        parent::removeObject( self::definition(), $conditions );
    }
791049
static function removeById( $attributeId, $version = null )
    {
        if ( $version !== null )
    	   $conds = array( 'contentobject_attribute_id' => $attributeId, 'contentobject_version' => $version  );
    	else
    	    $conds = array( 'contentobject_attribute_id' => $attributeId );

        eZPersistentObject::removeObject( self::definition(), $conds, null );
    }
351322
def delete(cls, object_version, key=None):
        
        with db.session.begin_nested():
            q = cls.query.filter_by(
                version_id=as_object_version_id(object_version))
            if key:
                q = q.filter_by(key=key)
            q.delete()
341543
public function selectVersion($version)
	{
		if ( ! in_array($version, $this->versions))
		{
			// not a value version
			return false;
		}

		$this->version = $version;

		return $this;
	}
479
public function savePreviousVersion($version)
    {
        if (!is_numeric($version)) {
            return;
        }

        try {
            $this->setVersionNumber($version);
            $this->owner->write();
        } catch (Exception $e) {
            throw new ValidationException(new ValidationResult(
                false,
                "Could not replace file #{$this->owner->ID} with version #$version."
            ));
        }
    }
1103561
public function setPhingVersion($version)
    {
        $version = str_replace('phing', '', strtolower($version));
        $this->phingVersion = (string) trim($version);
    }
686115
public function saveLastProcessedVersion($version)
    {
        $this->lastProcessedVersion = $version;
        $this->myCreateColumn       = null;
        $this->deleteFromSQL(['serverurl' => constant('FLEXIBEE_URL')]);
        if (is_null($this->insertToSQL(['serverurl' => constant('FLEXIBEE_URL'),
                    'changeid' => $version]))) {
            $this->addStatusMessage(_("Last Processed Change ID Saving Failed"),
                'error');
        } else {
            if ($this->debug === true) {
                $this->addStatusMessage(sprintf(_('Last Processed Change ID #%s Saved'),
                        $version));
            }
        }
    }
155602
public static function formatVersion($version)
    {
        return sprintf('%s-%s-%s %s:%s:%s',
            substr($version, 0, 4),
            substr($version, 4, 2),
            substr($version, 6, 2),
            substr($version, 8, 2),
            substr($version, 10, 2),
            substr($version, 12, 2)
        );
    }