You have the annotation in your ID field. You need to put this annotation at
the class level:

/**
 *
@orm:Entity(repositoryClass="Sensio\HelloBundle\Entity\Repository\CustomerRepository")
 * @orm:HasLifecycleCallbacks
 */
class Customer
{
    //...
}


Regards.

On Thu, Feb 10, 2011 at 5:31 AM, stof <s...@notk.org> wrote:

> On Wed, 9 Feb 2011 23:25:44 -0800 (PST), jdewit
> <jorisdewitblackbe...@gmail.com> wrote:
> > I can't get @PrePersist to work.
> >
> >
> > Also, how come I have to set "nullable=true" for each field to prevent
> the
> > error? I've used Doctrine2 before and never had to. Is there a better
> way?
>
> As for all other Doctrine annotations, you have to add the @orm: prefix on
> the annotation.
>
> If you want to allow NULL values in the database, you have to use
> 'nullable="true"'. This is exactly what it does.
>
> Regards
>
> --
> Christophe | Stof
>
> --
> If you want to report a vulnerability issue on symfony, please send it to
> security at symfony-project.com
>
> 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
> symfony-users+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/symfony-users?hl=en
>

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

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