本文整理汇总了PHP中FeedItem::getForetagItems方法的典型用法代码示例。如果您正苦于以下问题:PHP FeedItem::getForetagItems方法的具体用法?PHP FeedItem::getForetagItems怎么用?PHP FeedItem::getForetagItems使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FeedItem
的用法示例。
在下文中一共展示了FeedItem::getForetagItems方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: listRelevantFeedItems
private function listRelevantFeedItems($count = 100)
{
// Hämtar alla FeedItems som berör en medlem
if (empty($this->relevantFeedItems)) {
global $db;
$sql = "\n\t\t\t\nSELECT \n\tid \nFROM \n\t" . self::RELATION_TABLE . " \nWHERE \n\tmedlem_id IN (\n\t\tSELECT id \n\t\tFROM " . self::MEDLEM_TABLE . " \n\t\tWHERE \n\t\t\n\t\t\tid IN \n\t\t\t\t( \n\t\t\t\t\tSELECT kontakt_id \n\t\t\t\t\tFROM " . Adressbok::RELATION_TABLE . "\n\t\t\t\t\tWHERE medlem_id = " . $this->getMedlem()->getId() . "\n\n\t\t\t\t) OR id IN (\n\t\t\t\t\tSELECT medlem_id \n\t\t\t\t\tFROM " . Foretag::KEY_TABLE . " \n\t\t\t\t\tWHERE lag_id in (\n\t\t\t\t\t\tSELECT lag_id \n\t\t\t\t\t\tFROM " . Foretag::KEY_TABLE . " \n\t\t\t\t\t\tWHERE medlem_id = " . $this->getMedlem()->getId() . "\n\t\t\t\t\t)\t\t\n\t\t\t\t)\n\t\t\n\t)\t\n\tOR\n\tgrupp_id IN (\n\t\n\t\tSELECT grupp_id \n\t\tFROM " . Grupp::RELATION_TABLE . " \n\t\tWHERE medlem_id = " . $this->getMedlem()->getId() . "\n\t\n\t)\n\n\t" . "\n\tOR\n\tid IN (\n\t\n\t\tSELECT\n\t\t\t" . self::RELATION_TABLE . ".id\n\t\tFROM\n\t\t\t" . self::RELATION_TABLE . " JOIN " . Grupp::RELATION_TABLE . "\n\t\t\tON " . self::RELATION_TABLE . ".medlem_id = " . Grupp::RELATION_TABLE . ".medlem_id\n\t\tWHERE \n\t\t\t" . self::RELATION_TABLE . ".medlem_id = " . $this->getMedlem()->getId() . " AND\n\t\t\t" . self::RELATION_TABLE . ".datum >= " . Grupp::RELATION_TABLE . ".datum\n\n\t)\n\tOR\n\t(typ = 'lagttilliadressbok' AND params = '" . $this->getMedlem()->getId() . "|" . $this->getMedlem()->getANamn() . "')\n\tOR\n\t(typ = 'valkommen' AND medlem_id = " . $this->getMedlem()->getId() . ")\n";
$this->relevantFeedItems = FeedItem::listByIds($db->valuesAsArray($sql));
/* Lag and Foretagsfeeds */
global $USER;
if (isset($USER)) {
$foretag = $USER->getForetag();
if (isset($foretag)) {
$foretagFeeds = array();
$foretagFeeds = FeedItem::getForetagItems($foretag);
$this->relevantFeedItems = array_merge($this->relevantFeedItems, $foretagFeeds);
}
$lag = $USER->getLag();
if (isset($lag)) {
$lagFeeds = array();
$lagFeeds = FeedItem::getLagItems($lag);
$this->relevantFeedItems = array_merge($this->relevantFeedItems, $lagFeeds);
}
if (true || isset($lag) || isset($foretag)) {
/* no need to sort if no feeds are added, handled thru mobject-fetch */
$this->relevantFeedItems = self::sortFeeds($this->relevantFeedItems);
}
}
}
// print_r($this->relevantFeedItems);
return $this->relevantFeedItems;
}