문제

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?

도움이 되었습니까?

해결책

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!

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top