> Call to a member function getNazwa() on a non-object

In this case it looks like the problem is not field 'nazwa', it's
getRole() that returns null. And since getRole() returns null, you
can't call getNazwa() on it.

Try this:

<?php
$role = $partner->getRole();
if ($role) echo $role->getNazwa();
?>

On Fri, Jan 23, 2009 at 6:43 AM, Tomasz Ignatiuk
<[email protected]> wrote:
>
> Hi guys
>
> I read in doc (Admin Generator) about partial fields. There is a code
> for partial like this:
> <?php echo link_to($comment->getBlogArticle()->getTitle(),
> '@article_edit', $comment->getBlogArticle()) ?>
>
> So I used this in my project:
>
> <?php  echo $partner->getRole()->getNazwa();
>
> It works when a "nazwa" field in database has value. If it is an empty
> field, there is an error:
>
> Call to a member function getNazwa() on a non-object
>
> How to make it work? I used if with !is_null but it doesn't work.
> >
>



-- 
Blue Horn Ltd - System Development
http://bluehorn.co.nz

--~--~---------~--~----~------------~-------~--~----~
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