I know that I can do "Model::setUp(["castOnHydrate" => true])" and doing $myModel->toArray() will return properly typed field values.
Now the issue is that even after doing Model::setUp(), following code still returns alll the values as strings:
$entities = $this->modelsManager->createBuilder()
->from(['mm' => 'MyModel'])
->getQuery()->execute();
print_r($entities->toArray());
Is there a simple way to make sure the values are properly typed in this case too?