The only reason would be to match the default value on the DB side: if you
develop code-first then this is not necessary.

Marco Pivetta

http://twitter.com/Ocramius

http://ocramius.github.com/

On 24 August 2015 at 21:43, matthew_be <[email protected]> wrote:

> The @Column annotation allows to specify a default value, e.g. :
>
> /**
>  * @Column(type="integer", options={"default":0})
>  */
> protected $loginCount;
>
>
> but I was thinking that I could just set a default value in php:
>
> /**
>  * @Column(type="integer")
>  */
> protected $loginCount = 0;
>
> Is there any reason to use *default *in the annotation over just setting
> a default value for the property in php?
>
> --
> 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/d/optout.
>

-- 
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/d/optout.

Reply via email to