本文整理汇总了PHP中Result::setTagSearched方法的典型用法代码示例。如果您正苦于以下问题:PHP Result::setTagSearched方法的具体用法?PHP Result::setTagSearched怎么用?PHP Result::setTagSearched使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Result
的用法示例。
在下文中一共展示了Result::setTagSearched方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getResourcesForTag
public function getResourcesForTag($tag)
{
if ($DEBUGMODEON) {
echo "Entered getresourcesForTag, flickr plugin<br>";
}
//Getting the tag label
$tagtosearch = $tag->getLabel();
//Retrieving photo
$Photo = $this->FlickrLib->photos_search(array("tags" => $tagtosearch, "sort" => 'relevance', 'per_page' => '30'));
//if no picture found...
if (count($Photo['photo']) == 0) {
return array();
}
//Building resource objects
foreach ($Photo["photo"] as $singlepic) {
$TempRes = new Result();
$TempRes->setUrl("http://www.flickr.com/photos/" . $singlepic['owner'] . "/" . $singlepic['id']);
$TempRes->setTitle($singlepic["title"]);
$TempRes->setShownContent($this->FlickrLib->buildPhotoURL($singlepic, "Square"));
$TempRes->setDescription("");
$TempRes->setTagSearched($tag);
$TempRes->setContentType(1);
//images
$ResourceBundle[] = $TempRes;
}
return $ResourceBundle;
}