本文整理汇总了PHP中Marketplace::getAvailableMarketplaceItems方法的典型用法代码示例。如果您正苦于以下问题:PHP Marketplace::getAvailableMarketplaceItems方法的具体用法?PHP Marketplace::getAvailableMarketplaceItems怎么用?PHP Marketplace::getAvailableMarketplaceItems使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Marketplace
的用法示例。
在下文中一共展示了Marketplace::getAvailableMarketplaceItems方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkPackageUpdates
/**
* Runs through all packages on the marketplace, sees if they're installed here, and updates the available version number for them
*/
public static function checkPackageUpdates()
{
Loader::model('system_notification');
$items = Marketplace::getAvailableMarketplaceItems(false);
foreach ($items as $i) {
$p = Package::getByHandle($i->getHandle());
if (is_object($p)) {
// we only add a notification if it's newer than the last one we know about
if (version_compare($p->getPackageVersionUpdateAvailable(), $i->getVersion(), '<') && version_compare($p->getPackageVersion(), $i->getVersion(), '<')) {
SystemNotification::add(SystemNotification::SN_TYPE_ADDON_UPDATE, t('An updated version of %s is available.', $i->getName()), t('New Version: %s.', $i->getVersion()), '', View::url('/dashboard/extend/update'), $i->getRemoteURL());
}
$p->updateAvailableVersionNumber($i->getVersion());
}
}
}
示例2: array_merge
$coreBlockTypes[] = $_bt;
} else {
$webBlockTypes[] = $_bt;
}
}
}
$availableArray = array_merge($btAvailableArray, $pkgAvailableArray);
usort($availableArray, 'sortAvailableArray');
/* Load featured add-ons from the marketplace.
*/
Loader::model('collection_attributes');
$db = Loader::db();
if(ENABLE_MARKETPLACE_SUPPORT && $tp->canInstallPackages()){
$purchasedBlocksSource = Marketplace::getAvailableMarketplaceItems();
}else{
$purchasedBlocksSource = array();
}
// now we iterate through the purchased items (NOT BLOCKS, THESE CAN INCLUDE THEMES) list and removed ones already downloaded
// This really should be made into a more generic object since it's not block types anymore.
$skipHandles = array();
foreach($availableArray as $ava) {
foreach($purchasedBlocksSource as $pi) {
if ($pi->getHandle() == $ava->getPackageHandle()) {
$skipHandles[] = $ava->getPackageHandle();
}
}
}