本文整理汇总了PHP中SearchResult::newFromTitle方法的典型用法代码示例。如果您正苦于以下问题:PHP SearchResult::newFromTitle方法的具体用法?PHP SearchResult::newFromTitle怎么用?PHP SearchResult::newFromTitle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SearchResult
的用法示例。
在下文中一共展示了SearchResult::newFromTitle方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: next
public function next()
{
if ($this->fetched || !$this->result) {
return false;
}
$this->fetched = true;
return SearchResult::newFromTitle($this->result);
}
示例2: next
function next()
{
if ($this->resultSet === false) {
return false;
}
$row = $this->resultSet->fetchObject();
if ($row === false) {
return false;
}
return SearchResult::newFromTitle(Title::makeTitle($row->page_namespace, $row->page_title), $this);
}
示例3: provideRewriteQueryWithSuggestion
public function provideRewriteQueryWithSuggestion()
{
return array(array('With suggestion and no rewritten query shows did you mean', '/Did you mean: <a[^>]+>first suggestion/', new SpecialSearchTestMockResultSet('first suggestion', null, array(SearchResult::newFromTitle(Title::newMainPage())))), array('With rewritten query informs user of change', '/Showing results for <a[^>]+>first suggestion/', new SpecialSearchTestMockResultSet('asdf', 'first suggestion', array(SearchResult::newFromTitle(Title::newMainPage())))), array('When both queries have no results user gets no results', '/There were no results matching the query/', new SpecialSearchTestMockResultSet('first suggestion', 'first suggestion', array())));
}
示例4: provideRewriteQueryWithSuggestion
public function provideRewriteQueryWithSuggestion()
{
return array(array('With results and a suggestion does not run suggested query', '/Did you mean: <a[^>]+>first suggestion/', array(new SpecialSearchTestMockResultSet('first suggestion', array(SearchResult::newFromTitle(Title::newMainPage()))), new SpecialSearchTestMockResultSet('was never run', array()))), array('With no results and a suggestion responds with suggested query results', '/Showing results for <a[^>]+>first suggestion/', array(new SpecialSearchTestMockResultSet('first suggestion', array()), new SpecialSearchTestMockResultSet('second suggestion', array(SearchResult::newFromTitle(Title::newMainPage()))))), array('When both queries have no results user gets no results', '/There were no results matching the query/', array(new SpecialSearchTestMockResultSet('first suggestion', array()), new SpecialSearchTestMockResultSet('second suggestion', array()))));
}