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
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
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
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