$days = HabitMark::find(['goal_id = ?0', 'bind' => [$this->id]])->toArray();
echo '<pre>';
var_dump($days);
exit();
array (size=1)
0 =>
array (size=5)
'goal_id' => string '116' (length=3)
'date' => string '2019-08-21' (length=10)
'status' => string '0' (length=1)
'days_count' => null
'date_fail' => null
But in DB fileds goal_id and status have integer type. How can I get attributes with correct types?
You can disable this behavior by setting:
'options' => [
PDO::ATTR_EMULATE_PREPARES => false,
PDO::ATTR_STRINGIFY_FETCHES => false,
PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8',
],
At least it works for me in 3.x
Most helpful comment
You can disable this behavior by setting:
At least it works for me in 3.x