Using Model constants all over app

2011-12-23 Thread func0der
Hey guys, i worked a lit with Magento in the last months. They used, in my opinion, a really good way to configurate and/or access for example status fields. They had a table field for example for the status of an order. 0 meant cancelled 1 meant payed 2 meant completed In the Model they used

Re: Using Model constants all over app

2011-12-23 Thread euromark
that's exactly how I do it: http://www.dereuromark.de/2010/06/24/static-enums-or-semihardcoded-attributes/ On 23 Dez., 11:23, func0der funco...@web.de wrote: Hey guys, i worked a lit with Magento in the last months. They used, in my opinion, a really good way to configurate and/or access

Re: Using Model constants all over app

2011-12-23 Thread func0der
i found that one, too. Just wondered if there is any better solution to it or to the whole thing. On Dec 23, 12:54 pm, euromark dereurom...@googlemail.com wrote: that's exactly how I do it:http://www.dereuromark.de/2010/06/24/static-enums-or-semihardcoded-at... On 23 Dez., 11:23, func0der

Re: Using Model constants all over app

2011-12-23 Thread Miles J
Thats the only good way of mimicking enums in PHP. Since constants are static by nature, just call them whereever you need them. If the order class is not in scope within the page, either load the model, or include it with App. Really your only options. On Dec 23, 5:50 am, func0der