本文整理汇总了PHP中Versions::history方法的典型用法代码示例。如果您正苦于以下问题:PHP Versions::history方法的具体用法?PHP Versions::history怎么用?PHP Versions::history使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Versions
的用法示例。
在下文中一共展示了Versions::history方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: test_history
/**
* @depends test_diff
*/
function test_history()
{
// test history
$history = Versions::history(self::$foo);
$this->assertEquals(count($history), 2);
$modified = Versions::diff($history[0], $history[1]);
$this->assertEquals($modified[0], 'name');
// get a count with class name (groups by pkey, so one result)
$history = Versions::history('Foobar', true);
$this->assertEquals($history, 1);
// get a count with object (all for the item, so two results)
$history = Versions::history(self::$foo, true);
$this->assertEquals($history, 2);
// get history from class name (groups by pkey, so one result)
$history = Versions::history('Foobar');
$this->assertEquals(count($history), 1);
}
示例2: admin_filter_user_name
$classes = Versions::get_classes();
$deleted = false;
if (isset($_GET['type'])) {
$class = $_GET['type'];
if (isset($_GET['id']) && !empty($_GET['id'])) {
$obj = new $class($_GET['id']);
if ($obj->error) {
// deleted item
$obj->{$obj->key} = $_GET['id'];
$deleted = true;
}
} else {
$obj = $class;
}
$history = Versions::history($obj, $limit, $_GET['offset']);
$count = Versions::history($obj, true);
} else {
$history = array();
$count = 0;
}
function admin_filter_user_name($id)
{
$u = new User($id);
if ($u->error) {
return i18n_get('Nobody');
}
return $u->name;
}
$page->title = i18n_get('Versions of') . ' ' . $_GET['type'];
if (!empty($_GET['id'])) {
$page->title .= ' / ' . $_GET['id'];