本文整理匯總了PHP中Value::open_value_version_id方法的典型用法代碼示例。如果您正苦於以下問題:PHP Value::open_value_version_id方法的具體用法?PHP Value::open_value_version_id怎麽用?PHP Value::open_value_version_id使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Value
的用法示例。
在下文中一共展示了Value::open_value_version_id方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: delete_version
/**
* @see ValueInterface::delete_version()
* @param integer $internal_revision
* @return bool
*/
public function delete_version($internal_revision)
{
global $transaction;
if ($this->value_id and $this->value and $this->value_version) {
if (is_numeric($internal_revision)) {
$this->open_internal_revision($internal_revision);
$number_of_root_major_versions = ValueVersion_Access::get_number_of_root_major_versions_by_toid($this->value_id);
if ($number_of_root_major_versions > 1) {
$transaction_id = $transaction->begin();
$value_version_id = ValueVersion_Access::get_entry_by_toid_and_internal_revision($this->value_id, $internal_revision);
$minor_value_array = ValueVersion_Access::list_entries_by_previous_version_id($value_version_id);
if (is_array($minor_value_array) and count($minor_value_array) >= 1) {
foreach ($minor_value_array as $fe_key => $fe_value) {
$value = new Value($this->value_id);
$value->open_value_version_id($fe_value);
if ($value->delete_version($value->get_internal_revision()) == false) {
if ($transaction_id != null) {
$transaction->rollback($transaction_id);
}
return 0;
}
}
}
if ($this->value_version->get_current() == true) {
$next_current_value_version_id = ValueVersion_Access::get_last_uploaded_version_entry_by_toid($this->value_id, $internal_revision);
$value_version_access = new ValueVersion_Access($next_current_value_version_id);
$value_version_access->set_current(true);
}
if ($this->value_version->delete() == false) {
if ($transaction_id != null) {
$transaction->rollback($transaction_id);
}
return 0;
} else {
if ($transaction_id != null) {
$transaction->commit($transaction_id);
}
return 1;
}
} else {
if ($this->delete() == true) {
return 2;
} else {
return 0;
}
}
} else {
return 0;
}
} else {
return 0;
}
}