本文整理汇总了PHP中Feed::factory方法的典型用法代码示例。如果您正苦于以下问题:PHP Feed::factory方法的具体用法?PHP Feed::factory怎么用?PHP Feed::factory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Feed
的用法示例。
在下文中一共展示了Feed::factory方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: action_feed
/**
* Action to get only single feed html
* @param int feed_id
* will be used in ajax requests to get the recently added field
*/
public function action_feed()
{
$feed_id = $this->request->param('feed_id');
$feed = ORM::factory('feed', $feed_id);
$feeds = array();
$feeds[$feed->id] = Feed::factory($feed->type, $feed->id)->render();
$view = View::factory('feed/feeds')->bind('feeds', $feeds);
$this->content = $view;
}
示例2: countFeeds
protected function countFeeds()
{
return Feed::factory()->count();
}
示例3: discussion
/**
* Search linked entries
* @route /discussion
* @args url={url}
*/
public function discussion($arguments)
{
if (isset($arguments['url']) && !empty($arguments['url'])) {
$search_method = 'strict';
$url = trim($arguments['url']);
$entries = Feed::factory()->select_expr('feeds.id AS feed_id, feeds.url AS feed_url, feeds.link AS feed_link, feeds.title AS feed_title')->select_expr('entries.id, date, permalink, entries.title, content, categories')->join('entries', array('entries.feed_id', '=', 'feeds.id'))->order_by_desc('date');
if ($search_method == 'strict') {
$entries->where('entries.permalink', $url);
} else {
if ($search_method == 'large') {
// TODO: à réfléchir...
$url = trim($url, '/') . '%';
$entries->where_like('entries.permalink', $url);
}
}
$entries = $entries->findArray();
if ($entries != null) {
foreach ($entries as &$entry) {
$entry['feed']['id'] = $entry['feed_id'];
$entry['feed']['url'] = $entry['feed_url'];
$entry['feed']['link'] = $entry['feed_link'];
$entry['feed']['title'] = $entry['feed_title'];
unset($entry['feed_id'], $entry['feed_url'], $entry['feed_link'], $entry['feed_title']);
}
}
return $entries;
} else {
throw new ShaarliApiException('Need url (?url=url)');
}
}