Symfony - Propel - 值不是整数

时间:2011-03-01 08:12:26

标签: symfony1 propel

在我的架构中我设置了大小:

size:{type:bigint,required:true}

我生成的'基础'模型给了我:

public function setSize($v)
{
    if ($v !== null) {
        $v = (string) $v;
    }

    if ($this->size !== $v) {
        $this->size = $v;
        $this->modifiedColumns[] = TorrentPeer::SIZE;
    }

    return $this;
} // setSize()

为什么它是字符串而不是整数呢?

我现在收到错误:

"7818435653" is not an integer.

我尝试将(字符串)更改为(int),但它不起作用,我收到同样的错误。当我指定bigint时,我很困惑为什么Propel会创建这个值字符串。有什么帮助吗?

1 个答案:

答案 0 :(得分:2)

推动将bigint存储为字符串,因为PHP的整数类型太小:http://www.propelorm.org/wiki/Documentation/1.5/Schema#NumericTypes