コード例 #1
0
 /**
  * @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
0
 /**
  * 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
0
 /**
  * @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
0
ファイル: AO.php プロジェクト: ronseigel/agent-ohm
 /**
  * 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
0
 /**
  * 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
0
 /**
  * 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
0
ファイル: App.php プロジェクト: NatashaOlut/Mage_Test
 /**
  * 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
0
 /**
  * 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;
 }