本文整理汇总了PHP中PhabricatorApplicationSearchEngine::loadAllNamedQueries方法的典型用法代码示例。如果您正苦于以下问题:PHP PhabricatorApplicationSearchEngine::loadAllNamedQueries方法的具体用法?PHP PhabricatorApplicationSearchEngine::loadAllNamedQueries怎么用?PHP PhabricatorApplicationSearchEngine::loadAllNamedQueries使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PhabricatorApplicationSearchEngine
的用法示例。
在下文中一共展示了PhabricatorApplicationSearchEngine::loadAllNamedQueries方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: buildQueriesBox
private function buildQueriesBox(PhabricatorApplicationSearchEngine $engine)
{
$viewer = $this->getViewer();
$info = pht(<<<EOTEXT
You can choose a builtin or saved query as a starting point for filtering
results by selecting it with `queryKey`. If you don't specify a `queryKey`,
the query will start with no constraints.
For example, many applications have builtin queries like `"active"` or
`"open"` to find only active or enabled results. To use a `queryKey`, specify
it like this:
```lang=json, name="Selecting a Builtin Query"
{
...
"queryKey": "active",
...
}
```
The table below shows the keys to use to select builtin queries and your
saved queries, but you can also use **any** query you run via the web UI as a
starting point. You can find the key for a query by examining the URI after
running a normal search.
You can use these keys to select builtin queries and your configured saved
queries:
EOTEXT
);
$named_queries = $engine->loadAllNamedQueries();
$rows = array();
foreach ($named_queries as $named_query) {
$builtin = $named_query->getIsBuiltin() ? pht('Builtin') : pht('Custom');
$rows[] = array($named_query->getQueryKey(), $named_query->getQueryName(), $builtin);
}
$table = id(new AphrontTableView($rows))->setHeaders(array(pht('Query Key'), pht('Name'), pht('Builtin')))->setColumnClasses(array('prewrap', 'pri wide', null));
return id(new PHUIObjectBoxView())->setHeaderText(pht('Builtin and Saved Queries'))->setCollapsed(true)->appendChild($this->buildRemarkup($info))->appendChild($table);
}