If you're using PHP5 you can try class constants for this: http://ru2.php.net/manual/en/language.oop5.constants.php Because defines are _global_ as euromark mentioned.
On Aug 25, 5:53 pm, pph7 <[email protected]> wrote: > Hi there! > I am looking for a way to define custom constants in models. I realize > it is possible to define global constants in bootstrap.php and this > works well but for example, when I want to define user roles for > different acces rights like > > define("USER_ROLE_READER", 1); > define("USER_ROLE_PUBLISHER", 2); > > The logical way for me would to do that in the User model so I can > access these constant with > > User::USER_ROLE_READER > > etc. > > Is there a way to do this or do you disagree with my approach? > > thx! > mark --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---
