Symfony2的学说小数precision规模注释被忽略 [英] symfony2 doctrine decimal precision scale annotations are ignored

查看:150
本文介绍了Symfony2的学说小数precision规模注释被忽略的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经设置了一个属性在我的实体是这样的:

i've set up an attribute in my entity like this :

/**
 * @var decimal
 *
 * @ORM\Column(name="latitude", type="decimal", precision=10, scale=7, nullable=true)
 */
private $latitude;

但是当我生成数据库模式:学说:数据库:创建;学说:模式:创建

but when i generate the database schema with : doctrine:database:create; doctrine:schema:create

我的领域在数据库中设置为十进制(10,0)(当我仰望与phpMyAdmin)
所以,当像插入数据的 42.123456 与表单,该数据被截断为 42

my field is set up to decimal (10,0) in the database (when i look up with phpmyadmin) and so, when in insert data like 42.123456 with a form, this data is truncated to 42.

我怎样才能解决这个问题?

how can i resolve this?

感谢。

推荐答案

好吧,终于可以解决这个问题。
只需手动删除缓存(应用程序/缓存/..)

Ok, finally get to resolve this. Simply manually remove the cache (app/cache/..)

这是symfony的命令缓存删除它:明确的不会围绕这个问题

removing it by symfony command cache:clear wont revolve the problem

这篇关于Symfony2的学说小数precision规模注释被忽略的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆