本文整理汇总了PHP中History::getAll方法的典型用法代码示例。如果您正苦于以下问题:PHP History::getAll方法的具体用法?PHP History::getAll怎么用?PHP History::getAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类History
的用法示例。
在下文中一共展示了History::getAll方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testClear
public function testClear()
{
$instance = new History();
$this->assertTrue($instance->add('foo'));
$this->assertTrue($instance->add('bar'));
$this->assertTrue($instance->clear());
$this->assertEquals([], $instance->getAll());
}
示例2: viewItemHistory
private function viewItemHistory()
{
/* Bail out if the user doesn't have SA permissions. */
if ($this->_realAccessLevel < ACCESS_LEVEL_DEMO) {
CommonErrors::fatal(COMMONERROR_PERMISSION, $this);
return;
//$this->fatal(ERROR_NO_PERMISSION);
}
/* Bail out if we don't have a valid data item type. */
if (!$this->isRequiredIDValid('dataItemType', $_GET)) {
CommonErrors::fatal(COMMONERROR_BADINDEX, $this, 'Invalid data item type.');
}
/* Bail out if we don't have a valid data item ID. */
if (!$this->isRequiredIDValid('dataItemID', $_GET)) {
CommonErrors::fatal(COMMONERROR_BADINDEX, $this, 'Invalid data item ID.');
}
$dataItemType = $_GET['dataItemType'];
$dataItemID = $_GET['dataItemID'];
switch ($dataItemType) {
case DATA_ITEM_CANDIDATE:
$candidates = new Candidates($this->_siteID);
$data = $candidates->get($dataItemID);
break;
case DATA_ITEM_JOBORDER:
$jobOrders = new JobOrders($this->_siteID);
$data = $jobOrders->get($dataItemID);
break;
case DATA_ITEM_COMPANY:
$companies = new Companies($this->_siteID);
$data = $companies->get($dataItemID);
break;
case DATA_ITEM_CONTACT:
$contacts = new Contacts($this->_siteID);
$data = $contacts->get($dataItemID);
break;
default:
CommonErrors::fatal(COMMONERROR_BADFIELDS, $this, 'Invalid data item type.');
break;
}
/* Get revision information. */
$history = new History($this->_siteID);
$revisionRS = $history->getAll($dataItemType, $dataItemID);
$this->_template->assign('active', $this);
$this->_template->assign('subActive', 'Login Activity');
$this->_template->assign('data', $data);
$this->_template->assign('revisionRS', $revisionRS);
$this->_template->display('./modules/settings/ItemHistory.tpl');
}