本文整理汇总了PHP中Mage_Core_Model_App::dispatchEvent方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Core_Model_App::dispatchEvent方法的具体用法?PHP Mage_Core_Model_App::dispatchEvent怎么用?PHP Mage_Core_Model_App::dispatchEvent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Core_Model_App
的用法示例。
在下文中一共展示了Mage_Core_Model_App::dispatchEvent方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _buildContainer
/**
* @return Container
*/
private function _buildContainer()
{
$this->_generatorConfig->addCompilerPass($this->_storeConfigCompilerPass);
$this->_generatorConfig->addCompilerPass($this->_injectableCompilerPass);
$this->_mageApp->dispatchEvent('symfony_container_before_container_generator', ['generator_config' => $this->_generatorConfig]);
$generator = new ContainerGenerator($this->_generatorConfig);
return $this->_container = $generator->getContainer();
}
示例2: _prepareAffectedProduct
/**
* Prepare affected product
*/
protected function _prepareAffectedProduct()
{
/** @var $modelCondition Mage_Catalog_Model_Product_Condition */
$modelCondition = $this->_factory->getModel('catalog/product_condition');
$productCondition = $modelCondition->setTable($this->_resource->getTable('catalogrule/affected_product'))->setPkFieldName('product_id');
$this->_app->dispatchEvent('catalogrule_after_apply', array('product' => $this->_getProduct(), 'product_condition' => $productCondition));
$this->_connection->delete($this->_resource->getTable('catalogrule/affected_product'));
}
示例3: dispatchEvent
/**
* @see Mage_Core_Model_App::dispatchEvent($eventName, $args)
*/
public function dispatchEvent($eventName, $args)
{
$event = new Varien_Event($args);
$event->setName($eventName);
$observer = new Varien_Event_Observer();
$observer->setData(array('event' => $event));
$observer->addData($args);
$this->_bar->update($observer->getEvent());
return parent::dispatchEvent($eventName, $args);
}
示例4: dispatchEvent
/**
* Dispatch event
*
* Calls all observer callbacks registered for this event
* and multiobservers matching event name pattern
*
* @param string $name
* @param array $args
*/
public static function dispatchEvent($name, array $data = array())
{
if (VPROF) {
Varien_Profiler::start('DISPATCH EVENT:' . $name);
}
$result = AO::$_app->dispatchEvent($name, $data);
if (VPROF) {
Varien_Profiler::stop('DISPATCH EVENT:' . $name);
}
return $result;
}
示例5: _resetSearchResults
/**
* Reset search results
*
* @return void
*/
protected function _resetSearchResults()
{
$adapter = $this->_getWriteAdapter();
$adapter->update($this->_getTable('catalogsearch/search_query'), array('is_processed' => 0));
$adapter->delete($this->_getTable('catalogsearch/result'));
$this->_app->dispatchEvent('enterprise_catalogsearch_reset_search_result', array());
}
示例6: _dispatchNotification
/**
* Dispatches an event after reindex
* @return Enterprise_Catalog_Model_Index_Action_Catalog_Category_Product_Refresh
*/
protected function _dispatchNotification()
{
$this->_app->dispatchEvent('catalog_category_product_full_reindex', array());
return $this;
}
示例7: dispatchEvent
/**
* Overriden for disabling events
* fire during fixture loading
*
* (non-PHPdoc)
* @see Mage_Core_Model_App::dispatchEvent()
*/
public function dispatchEvent($eventName, $args)
{
if ($this->_eventsEnabled) {
parent::dispatchEvent($eventName, $args);
if (!isset($this->_dispatchedEvents[$eventName])) {
$this->_dispatchedEvents[$eventName] = 0;
}
$this->_dispatchedEvents[$eventName]++;
}
return $this;
}
示例8: match
/**
* Match product rewrite
*
* @param array $rewriteRow
* @param string $requestPath
* @return bool
*/
public function match(array $rewriteRow, $requestPath)
{
if (Enterprise_Catalog_Model_Product::URL_REWRITE_ENTITY_TYPE != $rewriteRow['entity_type']) {
return false;
}
$rewriteParts = explode('/', $rewriteRow['request_path']);
$rewriteTail = array_pop($rewriteParts);
if (!empty($this->_seoSuffix)) {
$rewriteTail .= '.' . $this->_seoSuffix;
}
$requestParts = explode('/', $requestPath);
$requestTail = array_pop($requestParts);
if (strcmp($rewriteTail, $requestTail) === 0) {
$categoryPath = implode('/', $requestParts);
$productId = $this->_productResource->getProductIdByRewrite($rewriteRow['url_rewrite_id'], $this->_prevStoreId);
$isMatched = !empty($productId) && $this->_isRewriteRedefinedInStore($productId, $rewriteRow['request_path']) && $this->_isProductAssignedToCategory($productId, $categoryPath);
if ($isMatched) {
$this->_checkStoreRedirect($productId, $categoryPath);
if (!empty($categoryPath)) {
$categoryId = $this->_categoryResource->getCategoryIdByRequestPath($categoryPath, $this->_storeId);
$this->_app->dispatchEvent('catalog_category_product_fix_category_id', array('category_id' => $categoryId));
}
return true;
}
}
return false;
}