本文整理匯總了PHP中Varien_Event_Observer::getType方法的典型用法代碼示例。如果您正苦於以下問題:PHP Varien_Event_Observer::getType方法的具體用法?PHP Varien_Event_Observer::getType怎麽用?PHP Varien_Event_Observer::getType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Varien_Event_Observer
的用法示例。
在下文中一共展示了Varien_Event_Observer::getType方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: onCacheRefresh
public function onCacheRefresh(Varien_Event_Observer $event)
{
if (ConfigurationBuilder::MODEL_ALIAS === $event->getType()) {
$filePath = Mage::getBaseDir('cache') . '/' . ConfigurationBuilder::CACHED_CONTAINER;
if (file_exists($filePath)) {
unlink($filePath);
}
}
}
示例2: cleanCache
/**
* Clean timage cache
*
* @return Technooze_Timage_Model_Observer
*/
public function cleanCache(Varien_Event_Observer $observer)
{
$type = $observer->getType();
if ($type == 'timage') {
$cacheDir = Mage::getBaseDir('media') . DS . 'catalog' . DS . 'cache';
mageDelTree($cacheDir);
@mkdir($cacheDir);
}
return $this;
}
示例3: clearAopCache
/**
* Clears the AOP cache.
*
* Our metadata will be cleared by the magento backend, we don't have to
* do it here.
*
* @param Varien_Event_Observer $observer
* @return void
*/
public function clearAopCache($observer)
{
$type = $observer->getType();
if ($type && $type !== self::AOP_CACHE_TYPE) {
return;
}
// Recursively clean up the cache directory.
$files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($this->_getCacheDir(), RecursiveDirectoryIterator::SKIP_DOTS), RecursiveIteratorIterator::CHILD_FIRST);
foreach ($files as $file) {
$path = $file->getRealPath();
if ($file->isDir()) {
rmdir($path);
} else {
unlink($path);
}
}
}
示例4: onCacheRefresh
public function onCacheRefresh(Varien_Event_Observer $event)
{
if (Inviqa_SymfonyContainer_Model_ConfigurationBuilder::MODEL_ALIAS === $event->getType()) {
unlink(Mage::getBaseDir('cache') . '/' . Inviqa_SymfonyContainer_Model_ConfigurationBuilder::CACHED_CONTAINER);
}
}
示例5: onCacheRefresh
public function onCacheRefresh(Varien_Event_Observer $event)
{
if ($event->getType() === ConfigurationBuilder::MODEL_ALIAS) {
$this->clearCache();
}
}