Yes, it works! :) Thank you ver much.

I used:
parent::getTitle()

Whole function looks like this:

  public function getTitle($culture = null)
  {
    $cult = sfContext::getInstance()->getUser()->getCulture();
    if(strlen(parent::getTitle($cult)) > 0)
      return parent::getTitle($cult);
    else
    {
      foreach ($this->getArticleI18ns() as $art)
      {
        if(strlen(parent::getTitle($art->getCulture())) > 0)
          return parent::getTitle($art->getCulture());
      }
    }
  }


2010/2/22 Tom Ptacnik <to...@tomor.cz>

> public function getTitle($culture = null)
> {
>  return $this->getTitle('kr');
> }
>
> It crashes because of recursion .. you are calling this function over
> and over.
>
> If you want to overwrite the function, you must then call function
> from the parent class.
> probably:
> parent::_get('title');
>
>
>
> On 22 Ășn, 10:54, Tomasz Ignatiuk <tomek.ignat...@gmail.com> wrote:
> > Hi
> >
> > I have a system with admin generated backend. My system is in 'en'
> > language (culture).
> > I added article in 'kr' language (culture), so now for example title
> > field isn't shown in articles list because this article doesn't have a
> > I18n version in en. How to fix this?
> >
> > I tried to overwrite getTitle function in order to search for first
> > i18n version, but it allocate to much memory and crash.
> > Strange thing is when I make this:
> >
> >   public function getTitle($culture = null)
> >   {
> >       return $this->getTitle('kr');
> >     }
> >
> > it crashes, but when I make this
> >
> > public function getTitle($culture = null)
> >   {
> >       return $this->getSubtitle('kr');
> >     }
> >
> > it works, it gets subtitle instead of title.
>
> --
> You received this message because you are subscribed to the Google Groups
> "symfony users" group.
> To post to this group, send email to symfony-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> symfony-users+unsubscr...@googlegroups.com<symfony-users%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/symfony-users?hl=en.
>
>

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

Reply via email to