In my "Module.php" i have this code in getServiceConfig()
'FoobarTableGateway' => function ($sm) {
$dbAdapter = $sm->get('dbfoobar');
$resultSetPrototype = new ResultSet();
$resultSetPrototype->setArrayObjectPrototype(new Foobar());
return new TableGateway('foobartable', $dbAdapter, null, $resultSetPrototype);
},
Now, i have to write a matching Class with an "exchangeArray($data)
" method in, where i have to match every single column to a class property.
This will work, but:
How do i write this without having to write the matching by hand?
Is there some way of "automatching" the column, so i can handle the column 1:1 in my Entity? I think, i have to use something other than setArrayObjectPrototype
but i have not found anything on google yet.
Any help (some links or so) will do, thanks ;)