Re: int column update
Hans Lellelid <hans <at> velum.net>
2007-02-02 12:06:55 GMT
Hi Gordon,
Franke Gordon wrote:
> Hello,
>
> i have in the db and schema a int column so when i write:
> $table->setColumn('1'); // string int
>
> And the value in the db is 1 he will make an?
>
> So it is not better to convert the value to int before compare?
>
Well, for integer (numeric) fields we may want to check whether the
string is a number & then cast it before checking. We cannot, however,
blindly cast to an int before compare, because then this would no longer
work:
$table->setColumn(null);
(NULL would get converted to 0)
I think, though, that we could make this more usable, as suggested --
using is_numeric().
I created a ticket (http://propel.phpdb.org/trac/ticket/344) and added
you to CC, so you will get notified when it is completed (which will be
for 1.3 branch).
Thanks,
(Continue reading)