ZF2-289: TableGateway select() has no option to choose which columns will be fetched


$emails = new TableGateway('emails', $adapter); $rowset = $emails->select(array('idx' => 8081));

returns all columns inside of the emails table. Instead of this i want to only fetch only TWO column. ZF1 has option "from('emails', 'column_id') but ZF2 not.

Query to create: SELECT id, log FROM emails WHERE idx = 8081


Try this:

$table->select(function ($select) {
  $select->columns(array('col1', 'col2'));