On 22 Nov 2010, at 13:01, Ivo Võsa wrote:

>>> seams like today is feature request day :) so here goes mine.
>>> I'm using phptal with Doctrine ORM.
>>> Unfortunately Doctrine and phtpal have different understanding about what 
>>> exactly isset means.
>>> So every time i upgrade phptal i have to apply this little patch.
>> How does isset behave in Doctrine?
>> If $obj->foo exists, but is not loaded, does isset($obj->foo) return false?
> yes it will return false,
> and if you try to access it, it is loaded from database

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 

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.

regards, Kornel

PHPTAL mailing list

Reply via email to