public function fetchAll()
{
$fetchMode = $this->adapter->getFetchMode();
$all = $this->adapter->table($this->tableName)->orderBy('version')->get();
if (!is_array($all)) {
$all = $all->toArray();
}
return array_map(function ($v) use($fetchMode) {
switch ($fetchMode) {
case PDO::FETCH_OBJ:
return $v->version;
case PDO::FETCH_ASSOC:
return $v['version'];
default:
throw new RuntimeException("The PDO::FETCH_* constant {$fetchMode} is not supported");
}
}, $all);
}