from(Qs_Db::getPair('CountryState', 'cs'), [ 'countryId', 'value' => 'abbreviation', 'title' => 'name', ]); $select->join(Qs_Db::getPair('Country', 'c'), '`c`.`id` = `cs`.`countryId`', []); if (($countriesWithStates = $this->getConfigArray('countriesWithStates'))) { $select->where('`c`.`id` IN (?)', $countriesWithStates); } $select->order(['c.name', 'cs.name']); $list = $select->getAdapter()->fetchAll($select, [], Qs_Db::FETCH_GROUP); return $list; } }