本文整理汇总了PHP中PhabricatorApplicationSearchEngine::newQuery方法的典型用法代码示例。如果您正苦于以下问题:PHP PhabricatorApplicationSearchEngine::newQuery方法的具体用法?PHP PhabricatorApplicationSearchEngine::newQuery怎么用?PHP PhabricatorApplicationSearchEngine::newQuery使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PhabricatorApplicationSearchEngine
的用法示例。
在下文中一共展示了PhabricatorApplicationSearchEngine::newQuery方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: renderNewUserView
private function renderNewUserView(PhabricatorApplicationSearchEngine $engine, $force_nux)
{
// Don't render NUX if the user has clicked away from the default page.
if (strlen($this->getQueryKey())) {
return null;
}
// Don't put NUX in panels because it would be weird.
if ($engine->isPanelContext()) {
return null;
}
// Try to render the view itself first, since this should be very cheap
// (just returning some text).
$nux_view = $engine->renderNewUserView();
if (!$nux_view) {
return null;
}
$query = $engine->newQuery();
if (!$query) {
return null;
}
// Try to load any object at all. If we can, the application has seen some
// use so we just render the normal view.
if (!$force_nux) {
$object = $query->setViewer(PhabricatorUser::getOmnipotentUser())->setLimit(1)->execute();
if ($object) {
return null;
}
}
return $nux_view;
}