本文整理汇总了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();
}
}