本文整理汇总了PHP中FeedItem::gets方法的典型用法代码示例。如果您正苦于以下问题:PHP FeedItem::gets方法的具体用法?PHP FeedItem::gets怎么用?PHP FeedItem::gets使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FeedItem
的用法示例。
在下文中一共展示了FeedItem::gets方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: delete
function delete($itemId) {
global $database, $db;
list($feedId, $permalink) = FeedItem::gets($itemId, 'feed,permalink');
if (!$db->execute("INSERT INTO {$database['prefix']}DeleteHistory (feed, permalink) VALUES ('$feedId', '$permalink')"))
return false;
requireComponent('LZ.PHP.Media');
Media::delete($itemId);
requireComponent('Bloglounge.Data.Category');
$result = $db->queryAll('SELECT category FROM '.$database['prefix'].'Categoryrelations WHERE item = ' . $itemId,MYSQL_ASSOC);
$categoryIds = array();
foreach($result as $item) {
array_push($categoryIds, $item['category']);
}
$categoryIds = array_unique($categoryIds);
$db->execute("DELETE FROM {$database['prefix']}CategoryRelations WHERE item = {$itemId}"); // clear CategoryRelations
requireComponent('Bloglounge.Data.Groups');
$db->execute("DELETE FROM {$database['prefix']}TagRelations WHERE item = {$itemId}"); // clear TagRelations
if ($db->execute('DELETE FROM '.$database['prefix'].'FeedItems WHERE id='.$itemId)) {
if (Validator::getBool(Settings::get('useRssOut'))) {
requireComponent('Bloglounge.Data.RSSOut');
RSSOut::refresh();
}
foreach($categoryIds as $categoryId) {
Category::rebuildCount($categoryId);
}
return true;
} else {
return false;
}
}
示例2: getTitle
function getTitle($item, $feedId, $feedItemId = null) {
$title = array();
$autoUpdate = array();
$title['result'] = $item['title'];
/*list($autoUpdate['feed'], $title['feed']) = Feed::gets($feedId, 'autoUpdate,title');
$autoUpdate['feed'] = Validator::getBool($autoUpdate['feed']);
if (!$autoUpdate['feed'] && !Validator::is_empty($title['feed']))
$title['result'] = $title['feed'];*/ // 피드의 제목을 피드아이템 제목에 덮어 씌우는일이 없도록..
if (isset($feedItemId) || ($feedItemId !== false)) { // update
requireComponent('Bloglounge.Data.FeedItems');
list($autoUpdate['item'], $title['item']) = FeedItem::gets($feedItemId, 'autoUpdate,title');
$autoUpdate['item'] = Validator::getBool($autoUpdate['item']);
if (!$autoUpdate['item'] && !Validator::is_empty($title['item']))
$title['result'] = $title['item'];
}
return $title['result'];
}