Configuring Zend Framework
Our last step of setting up the database is to configure Zend Framework to use these new Data
Tables. Let’s start by defining the
CustomerTable
in the service manager. We’ll define this in the
global.php
config file, although in a real application, we’d probably find a much better place to
put this:
// config/autoload/global.php
use
CleanPhp\Invoicer\Domain\Entity\Customer;
use
CleanPhp\Invoicer\Persistence\Zend\DataTable\CustomerTable;
use
CleanPhp\Invoicer\Persistence\Zend\TableGateway\TableGatewayFactory;
use
Zend\Stdlib\Hydrator\ClassMethods;
return
[
'service_manager'
=>
[
'factories'
=>
[
'CustomerTable'
=>
function
(
$sm
) {
$factory
=
new
TableGatewayFactory();
$hydrator
=
Do'stlaringiz bilan baham: |