I'm working with Magento, I have orders and I print them like this:

echo $order->getId();
echo $order->getCustomerEmail();

My problem is that I don't know all the name of the get methods so how or where can I find all the list of get available?

My goal is export all the orders in an external database, is there a faster way to do it without pass for each field?

  • take a look in sales_flat_order table, all field can be accessed via getFieldName (or getData('field_name')) and open the class Mage_Sales_Model_Order doc block help you too
    – bchatard
    Nov 30, 2015 at 16:34

6 Answers 6


The data on the order (or any object) is being held in a protected member variable _data which is an array. This data comes from the database table(s) (it is being filled by the resource model).

Data array

You can get this array and dump it via:

// or

You will get an output like this with print_r():

    [entity_id] => 2
    [state] => new
    [status] => pending
// ...


Now you can get all of this data with Magento object's magic getters. Each value is retrievable in the form of $object->getValue() where Value is the camel cased version of the key from the array.

For the above values use:


And for customer_id for example you can call $order->getCustomerId()


The getters can be overridden. The getters construction is defined in the Varien_Object class and each Magento model could override a magic getter method by explicitly defining a method. So you should also check the methods of the model by looking at the code or use hinting in your IDE.


You can simply print all available field in your object with:

  • ok, i used it and it shows a lot of fields but not all that i was looking for. Dec 1, 2015 at 9:47

Orders are not stored in an EAV format so all the data is in a flat table. By loading a sales/order model instance you load a row from the sales_flat_order table so any column you see here, you can pull from the order object, i.e to pull the increment_id column, you can call $order->getIncrementId(). Also be aware that there are some methods in the Mage_Sales_Model_Order class object to build a certain amount of data for you, for instance getCustomerName() which returns the customer name but does not relate to a customer_name column in the sales_flat_order table .



foreach($order->getData() as $key => $value)

An one line solution:

 $resource = Mage::getSingleton('core/resource');
 $readConnection = $resource->getConnection('core_read');  
  * Get the table name
 $tableName = $resource->getTableName('sales/order');


From: https://stackoverflow.com/questions/25245862/get-all-field-names-from-magento-model

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.