<code>
$resultSet = $this->tableGateway->select ( function ($select) {
$select->columns (
array (
'id',
'category_name'
) );
} );
tried with above code but it returning all columns, below is the output of return. I need to select id and category_name from database
Category\Model\Category Object
(
[id] => 2
[category_name] => Cat Two
[category_created] =>
[category_status] =>
[inputFilter:protected] =>
)
Category\Model\Category Object
(
[id] => 4
[category_name] => Cat one
[category_created] =>
[category_status] =>
[inputFilter:protected] =>
)