当前位置: 首页>>代码示例>>PHP>>正文


PHP PhabricatorApplicationSearchEngine::loadAllNamedQueries方法代码示例

本文整理汇总了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);
    }
开发者ID:pugong,项目名称:phabricator,代码行数:38,代码来源:PhabricatorSearchEngineAPIMethod.php


注:本文中的PhabricatorApplicationSearchEngine::loadAllNamedQueries方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。