Exemplo n.º 1
0
 /**
  * @magentoConfigFixture global/resources/db/table_prefix prefix_
  */
 public function testGetTableName()
 {
     $tableNameOrig = 'core_website';
     $tableSuffix = 'suffix';
     $tableName = $this->_model->getTable(array($tableNameOrig, $tableSuffix));
     $this->assertEquals('prefix_core_website_suffix', $tableName);
 }
 /**
  * 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'));
 }
 /**
  * Retrieve table name for the entity
  *
  * @param string $entityName
  * @return string
  */
 public function getTable($entityName)
 {
     if (is_array($entityName) || strpos($entityName, '/') !== false) {
         $table = parent::getTable($entityName);
     } else {
         $table = $entityName;
     }
     return $table;
 }