I strongly suggest you read and implement this 
http://en.wikipedia.org/wiki/Law_of_Demeter
And after you do that you will see you no longer have the problem you 
described.

Regards,
Kupo

Greg Freeman wrote:
> Ok, one of my tables has foreign keys that can be optional (NULL). I'm
> just wondering what is the best practice to use these values in a
> template. I use doSelectJoinAll() for this by the way.
>
> For example if in a template I put
>
> <?php echo $content->getcategory()->getName() ?>
>
> And the content does not have a category (i.e category_id in the
> content table is null) it causes an error. Now of course you could use
> php like isset etc but wouldn't that be breaking separation of logic
> etc.
>
> I guess I'm after a "best practices" solution.
>
> Thanks
>
>
> >
>
>   


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" 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/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to