I have a ZF3 project and an index controller that accesses a single postgres table. I have the usual factories setup
return array(
'factories' => [
Model\IsdepotstockTable::class => function($container) {
$tableGateway = $container->get(Model\IsdepotstockTableGateway::class);
return new Model\IsdepotstockTable($tableGateway);
},
Model\IsdepotstockTableGateway::class => function ($container) {
$dbAdapter = $container->get(AdapterInterface::class);
$resultSetPrototype = new ResultSet();
$resultSetPrototype->setArrayObjectPrototype(new Model\Isdepotstock());
return new TableGateway('isdepotstock', $dbAdapter, null, $resultSetPrototype);
},
],
I also have my controller constructor thus:
public function __construct(IsdepotstockTable $table)
{
$this->isdepotstockTable = $table;
}
My question is, if I wish to access a second table, how do I modify the construct statement to handle multiple tables? Obviously I have to add the factories for the additional table that much I understand.
I've looked through the ZF3 documentation but cannot find any example.
Thanks