Pergunta

I use console command to generate new entity:

$ php app/console doctrine:generate:entity

How can I set the options scale and precision for field of type decimal (and other options for other field types) by using this console command?

Foi útil?

Solução

You can't set precision and scale via console. You have to mention these attributes when you declare fields, either in ORM YAML file, as annotation, etc.

To see how to set precision and scale in annotation, here is the link,

http://docs.doctrine-project.org/en/2.0.x/reference/annotations-reference.html#column

You can see all available doctrine 2 data types in here,

http://doctrine-dbal.readthedocs.org/en/latest/reference/types.html

For Decimal precision and scale you can see it in here,

http://doctrine-dbal.readthedocs.org/en/latest/reference/types.html#id89

Hope this helps, Cheers!

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top