0

I have in module.php something like that

'OrderTableGateway' => function ($sm) {
$dbAdapter = $sm->get('Zend\Db\Adapter\Adapter');
$resultSetPrototype = new ResultSet();
$resultSetPrototype->setArrayObjectPrototype(new Order());
return new TableGateway('order', $dbAdapter, null, $resultSetPrototype);

and in OrderTable (tablegateway):

$data = new Paginator(new DbTableGateway($this >tableGateway,array('customer_id'=>$customer_id)); 
$data->setCurrentPageNumber(1);

and now i want change $data - add something to every row? is it possible? and how?

Looking more generally - I just want to add to object Order ( new Order () ), the result of another query - in this case, the list of products.

GingerHead
  • 8,130
  • 15
  • 59
  • 93
Tomek Kobyliński
  • 1,290
  • 14
  • 25
  • 1
    You would use a custom Hydrator to do this for you as each row is created. Let the hydrator add the object when each row/item is created. – Andrew Jun 24 '13 at 08:45
  • Thank you. Now of course it works. By the way I would like to ask if you know how such a thing is possible: select * from album,song where album.id = song.album_id; album.id | album.name | song.id | song.name 1 | Help | 1 | Help 1 | Help | 2 | Yesterday 2 | Revolver | 3 | Taxman 2 | Revolver | 4 | She said and now still using tablegateway, and have oportunty to use paginator etc achieve with minimal effort Album rowset or smth similar. 2 rows with "colum" songs with list of songs. I do not know if I made myself clear? – Tomek Kobyliński Jun 28 '13 at 14:55

0 Answers0