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


Get all field names from magento model

我如何从一个像"order"这样的对象中获得所有字段名而不创建或加载这个对象?

的例子:

Model: sales/order

通过加载订单和getData()方法,我得到了一个由各种字段名组成的数组,例如:

shipping_tax_amount
grand_total
base_tax_amount

如何在没有顺序的情况下获得这些字段名?在我的例子中,即使magento商店没有订单,也必须能够访问这些字段。

  $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);