thecodingmachine / mouf

The Mouf PHP framework: an open-source PHP framework providing an easy way to download, install, use and reuse components, with a graphical user interface.
MIT License
54 stars 28 forks source link

Unable to make a "foreach" on a newly created TDBM_Object #75

Closed WizMik closed 10 years ago

WizMik commented 10 years ago

When a Bean is created ( $dao->create() ), you can't acess its properties through a foreach (because the bean has no properties unless they've been initiated or loaded from the database).

It could be usefull to initiate Bean's properties of a newly created TDBM_Object with a foreach !

moufmouf commented 10 years ago

Indeed. In order to fix this, we would need to:

Basically, it is very difficult to fix. Moreover, it is likely TDBM 4 will not let you access properties directly (or do a foreach on a property) but instead will force you through the setters and getters. So you should probably avoid doing a foreach on an object since this will be deprecated. I'll keep this bug as a "won't fix".