php-activerecord
php-activerecord copied to clipboard
index not of right type after row creation
Consider the table foos:
+---+-------+
|id | foo |
+---+-------+
|INT|VARCHAR|
+---+-------+
If you then query using find_by_id, the result is as expected: an object (lets say $var) where $var->id is an int and $var->foo is a string
However, when creating a new row:
$var = new Foo;
$var->foo = 'bar';
$var->save();
Then $var->id is a string. I consider this unexpected behaviour and it caused me headaches until I realized that this was the case. I hope this can be fixed soon.