I want to do a simple join using zf2 selecting fields from the first and second table, but I get an error ('Statement could not be executed') when I try to put an array of fields into the columns method.
public function fetchAll()
{
$resultSet = $this->tableGateway->select(function (Select $select) {
$select->columns();// ->with params gives an 'Statement could not be executed'
$select->join(array('t2' => 'categories'), 'table1.idCategory = t2.id');
$select->order('dateTime DESC')->limit(100);
});
...
}