Hello,

I'm little concerned with getAttribute usage - because it returns
default null value when attribute name is wrong.

For example, using in template:
echo $sf_user->getAttribute("last_login");

instead of
echo $sf_user->getAttribute("lastlogin");

can lead to error which isn't noticed by php.

My question is - do i worry to much or should i use class properties
($sf_user->lastLogin) / methods ($sf_user->getLastLogin()) instead of
attributes?

Same problem exist with getParameter - for example in actions -
getting parameters from request, but this error is probably easier to
catch by programmer.

Maybe it would be nice to write getAttributeSafe() and getParameterSafe
() methods which would throw exception when attribute/parameter is not
found?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to