Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/json/15.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 从magento模型获取所有字段名_Php_Magento - Fatal编程技术网

Php 从magento模型获取所有字段名

Php 从magento模型获取所有字段名,php,magento,Php,Magento,在不创建或加载此对象的情况下,如何从“order”这样的对象获取所有字段名 例如: Model: sales/order 通过加载顺序和getData()方法,我得到了一个包含各种字段名的数组,如: shipping_tax_amount grand_total base_tax_amount 如果没有订单,如何获取这些字段名?在我的情况下,即使magento商店没有订单,也必须能够访问此字段。使用数据库表中的字段是否保存?如果可能的话,我希望避免直接访问数据库,并使用一些magento方法

在不创建或加载此对象的情况下,如何从“order”这样的对象获取所有字段名

例如:

Model: sales/order
通过加载顺序和getData()方法,我得到了一个包含各种字段名的数组,如:

shipping_tax_amount
grand_total
base_tax_amount

如果没有订单,如何获取这些字段名?在我的情况下,即使magento商店没有订单,也必须能够访问此字段。

使用数据库表中的字段是否保存?如果可能的话,我希望避免直接访问数据库,并使用一些magento方法。如果magento商店使用类似于
sales/flat\u order
的平板电脑,其表现如何?有什么问题吗?
  $resource = Mage::getSingleton('core/resource');
   $readConnection = $resource->getConnection('core_read');  
    /**
     * Get the table name
     */
    $tableName = $resource->getTableName('sales/order');

$saleafield=$readConnection->describeTable($tableName);
var_dump($saleafield);