本文整理汇总了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;
}
}