在我的架构中我设置了大小:
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会创建这个值字符串。有什么帮助吗?
答案 0 :(得分:2)
推动将bigint存储为字符串,因为PHP的整数类型太小:http://www.propelorm.org/wiki/Documentation/1.5/Schema#NumericTypes