Sorry, this:

    return $this->favoriteComments->toArray();

should be:

    return $this->userFavorites->toArray();

-- 
Jasper N. Brouwer
(@jaspernbrouwer)


On 6 Feb 2014, at 20:58, Jasper N. Brouwer <[email protected]> wrote:

> In addition to Herman's comment on step 3:
> 
> You can have getFavoriteComments() return an array in stead of the 
> ArrayCollection:
> 
>    public function getFavoriteComments()
>    {
>        return $this->favoriteComments->toArray();
>    }
> 
> This way you can't manipulate the ArrayCollection outside of the entity. So 
> you _have_ to use the addFavoriteComment() and removeFavoriteComment() 
> methods.

-- 
You received this message because you are subscribed to the Google Groups 
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to