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

paypal - How to know the URL referrer in PHP? -

oauth - Facebook OAuth2 Logout does not remove fb_ cookie -

wpf - Line breaks and indenting for the XAML of a saved FlowDocument? -