开发者

Symfony - Propel - Value is not an integer

开发者 https://www.devze.com 2023-02-13 21:38 出处:网络
in my schema I set the size: size:{ type: bigint, required: true } My generated \'base\' model gives me:

in my schema I set the size:

size: { type: bigint, required: true }

My generated 'base' model gives me:

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

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

    return $this;
} // setSize()

Why does it case it to a string and not an integer?

I now receive the error:

"7818435653" is not an integer.

I tried changing the (string) to (int), but it did not work, I receive the same error. I'm confused why Propel made th开发者_开发百科is value string when I specified bigint. Any help?


propel stores bigint as a string as PHP's integer type is too small: http://www.propelorm.org/wiki/Documentation/1.5/Schema#NumericTypes

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号