本文整理汇总了PHP中Dataset::SetLimit方法的典型用法代码示例。如果您正苦于以下问题:PHP Dataset::SetLimit方法的具体用法?PHP Dataset::SetLimit怎么用?PHP Dataset::SetLimit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dataset
的用法示例。
在下文中一共展示了Dataset::SetLimit方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ProcessMessages
function ProcessMessages()
{
if (GetApplication()->IsGETValueSet('page')) {
$this->pageNumber = GetApplication()->GetGETValue('page') - 1;
GetApplication()->SetSessionVariable($this->GetSessionPrefix() . 'page', $this->pageNumber);
} elseif (!$this->NeedResetPage() && GetApplication()->IsSessionVariableSet($this->GetSessionPrefix() . 'page')) {
$this->pageNumber = GetApplication()->GetSessionVariable($this->GetSessionPrefix() . 'page');
} else {
$this->ResetPageNumber();
}
if (GetApplication()->IsGETValueSet('recperpage')) {
$this->rowsPerPage = GetApplication()->GetGETValue('recperpage');
GetApplication()->SetSessionVariable($this->GetSessionPrefix() . 'recperpage', $this->rowsPerPage);
} elseif (GetApplication()->IsSessionVariableSet($this->GetSessionPrefix() . 'recperpage')) {
$this->rowsPerPage = GetApplication()->GetSessionVariable($this->GetSessionPrefix() . 'recperpage');
} else {
$this->rowsPerPage = $this->defaultRowPerPage;
}
if ($this->pageNumber >= $this->GetPageCount()) {
$this->pageNumber = $this->GetPageCount() - 1;
} elseif ($this->pageNumber < 0) {
$this->pageNumber = 0;
}
if (!in_array(GetOperation(), $this->ignorePageNavigationOperations)) {
if ($this->rowsPerPage != 0 && $this->GetRowCount() != 0) {
$this->dataset->SetUpLimit($this->pageNumber * $this->rowsPerPage);
$this->dataset->SetLimit($this->rowsPerPage);
}
}
}
示例2: Render
/**
* @param Renderer $renderer
* @return void
*/
public function Render(Renderer $renderer)
{
if (GetApplication()->GetSuperGlobals()->IsGetValueSet('term')) {
$this->dataset->AddFieldFilter($this->valueField, new FieldFilter('%' . GetApplication()->GetSuperGlobals()->GetGetValue('term') . '%', 'ILIKE', true));
}
$this->dataset->Open();
$result = array();
$highLightCallback = Delegate::CreateFromMethod($this, 'ApplyHighlight')->Bind(array(Argument::$Arg3 => $this->valueField, Argument::$Arg4 => GetApplication()->GetSuperGlobals()->GetGetValue('term')));
$this->dataset->SetLimit(20);
while ($this->dataset->Next()) {
$result[] = array("id" => $this->dataset->GetFieldValueByName($this->idField), "label" => $highLightCallback->Call($this->dataset->GetFieldValueByName($this->valueField), $this->valueField), "value" => $this->dataset->GetFieldValueByName($this->valueField));
}
echo SystemUtils::ToJSON($result);
$this->dataset->Close();
}
示例3: Render
/**
* @param Renderer $renderer
* @return void
*/
public function Render(Renderer $renderer)
{
$params = ArrayWrapper::createGetWrapper();
$term = $params->isValueSet('term') ? $params->getValue('term') : '';
if ($params->isValueSet('term')) {
$this->dataset->AddFieldFilter($this->valueField, new FieldFilter('%' . $term . '%', 'ILIKE', true));
}
if ($params->isValueSet('id')) {
$this->dataset->AddFieldFilter($this->idField, FieldFilter::Equals($params->getValue('id')));
}
if ($this->itemCount > 0) {
$this->dataset->SetUpLimit(0);
$this->dataset->SetLimit($this->itemCount);
}
$this->dataset->Open();
$result = array();
$highLightCallback = Delegate::CreateFromMethod($this, 'ApplyHighlight')->Bind(array(Argument::$Arg3 => $this->valueField, Argument::$Arg4 => $term));
while ($this->dataset->Next()) {
$result[] = array("id" => $this->dataset->GetFieldValueByName($this->idField), "label" => $highLightCallback->Call($this->dataset->GetFieldValueByName($this->valueField), $this->valueField), "value" => $this->dataset->GetFieldValueByName($this->valueField));
}
echo SystemUtils::ToJSON($result);
$this->dataset->Close();
}