Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ssis/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 数组中属性的条件语句_Php_Arrays_Magento_If Statement - Fatal编程技术网

Php 数组中属性的条件语句

Php 数组中属性的条件语句,php,arrays,magento,if-statement,Php,Arrays,Magento,If Statement,我有一个每天导入的数组。对于特定字段“特殊价格”,我只希望将其导入到主网站>主网站商店>默认商店视图中 默认商店视图=1 protected function _getFieldNames() { return array( 'company_number', 'sku', 'style_number', 'name',

我有一个每天导入的数组。对于特定字段“特殊价格”,我只希望将其导入到主网站>主网站商店>默认商店视图中

默认商店视图=1

  protected function _getFieldNames()
        {
            return array(
                'company_number',
                'sku',
                'style_number',
                'name',
                'div_code',
                'div_desc',
                'color_code',
                'color',
                'size_type',
                'size',
                'price',
                'weight',
                'description',
                'special_price',
                'tax_code',
            );
        }
我可以这样实例化这个类:

$storeId = Mage::app()->getStore()->getStoreId();
我的问题是如何仅为默认存储解析一个特定字段,并让其他更新照常运行。我假设我使用的是IF语句


是否可以基于IF语句取消设置该项?

$websites=Mage::app()->getWebsites()$default=$websites[1]->getDefaultStore();如何将其合并到阵列中@目标不确定,您的代码示例在呈现的上下文中令人困惑,这就是为什么我用注释而不是答案来回答。但这将为您提供默认存储。是否可以基于IF语句取消设置()该项@目标您可能能够按照以下方式执行:if(Mage::app()->getStore()->getStoreId()==Mage::app()->getWebsites()[1]->getDefaultStore()->getStoreId())返回数组(无特殊价格)$websites=Mage::app()->getWebsites()$default=$websites[1]->getDefaultStore();如何将其合并到阵列中@目标不确定,您的代码示例在呈现的上下文中令人困惑,这就是为什么我用注释而不是答案来回答。但这将为您提供默认存储。是否可以基于IF语句取消设置()该项@目标您可能能够按照以下方式执行:if(Mage::app()->getStore()->getStoreId()==Mage::app()->getWebsites()[1]->getDefaultStore()->getStoreId())返回数组(无特殊价格);