本文整理匯總了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');
}