Magento models: how to get data from an array, rather than a database? -


Usually, Magento's models are "backed" by a MySQL database - this is where the data comes , And it's up to. How do I get data from a standard PHP array? Is there any sample code available anywhere? (I am particularly interested in the "reading" aspect at this time, but it will be useful to know how to "write".)

If you save from a model and save it to your resource model,

  $ this-> _getResource () - & gt; Startup management (); $ DataCommited = false; {$ This-> Try _beforeSave (); If ($ this-> _dataSaveAllowed) {$ this- & gt; _getResource () - & gt; Save ($ this); $ This- & gt; _afterSave ();  

The method in this resource is

  $ this-> _getWriteAdapter ();  

from which you can call many SQL methods


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -