Kornel Lesiński wrote:
On 22 Nov 2010, at 14:00, Ivo Võsa wrote:

Kornel Lesiński wrote:
That breaks behavior expected of PHP properties. If $obj->foo is supposed to have 
non-NULL value, then isset($obj->foo) shouldn't be returning false.

I consider that a Doctrine bug (leaky abstraction) and suggest that you patch Doctrine's __isset() to return true if relation exists, even if it isn't loaded yet. I think that's a better solution — it will make Doctrine's abstraction more robust, and won't require PHPTAL to have workaround for other application's inconsistent behavior.
Easier said than done.
If users generaly have phonenumbers, it does not mean this concrete user has 
phonenumber, can't be sure about it before call to database has been made.

I'm not sure what you mean. If you're trying to output property in PHPTAL, then 
it has to be read anyway.
it won't get loaded if doctrine thinks it is allready loaded because __isset told so. i think it will be to much work to patch doctrine - and yes Doctrine 2, which is total rewrite, is coming out soon.
so either way it will probably be unofficial patch
Why is check for $obj->hasRelation() in PHPTAL ok, but not in Doctrine's 
__isset()?



_______________________________________________
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal

Reply via email to