So basically I want an array of integers from a query using
fetchAllKeyed for the results. The field is an tinyint in the db so I would expect an indexed array of integers but I am getting an indexed array of strings.
Here is the database call:
$query = $this->connection ->select('database_name', 'db') ->fields('db', ['first_index', 'value']) ->condition('db.value', 0, '<>') ->condition('second_index', $array, 'IN') ->execute(); $indexed_array_of_ints = $query->fetchAllKeyed();
I've tried to find other mentions of this issue and I haven't so maybe I'm just doing it wrong, I don't know.
I know that I can convert the values after the call, but I'm looking to make this operation as fast as possible so any help here would be greatly appreciated.