The Clean Architecture in php


function ( $sm ) { return new



Download 2,26 Mb.
Pdf ko'rish
bet170/179
Sana24.06.2021
Hajmi2,26 Mb.
#100337
1   ...   166   167   168   169   170   171   172   173   ...   179
Bog'liq
The-Clean-Architecture-in-PHP-Kristopher-Wilson

function
(
$sm
) {
return new
\Application\Controller\InvoicesController(
$sm
->
getServiceLocator
()
->
get
(
'InvoiceRepository'
),
$sm
->
getServiceLocator
()
->
get
(
'OrderRepository'
),
new
InvoicingService(
$sm
->
getServiceLocator
()
->
get
(
'OrderRepository'
),
new
InvoiceFactory()
)
);
},
'Application\Controller\Orders'
=>
function
(
$sm
) {
return new
\Application\Controller\OrdersController(
$sm
->
getServiceLocator
()
->
get
(
'OrderRepository'
),
$sm
->
getServiceLocator
()
->
get
(
'CustomerRepository'
),
new
OrderInputFilter(),
$sm
->
getServiceLocator
()
->
get
(
'OrderHydrator'
)
);
},
],
],
// ...
];
This would make a good place to commit your code to source control.
If you’re just reading, but want to see the code in action, you can checkout the tag
11-doctrine-integration:
git clone https://github.com/mrkrstphr/cleanphp-example.git
git checkout 11-doctrine-integration
Updating the Hydrators
The last update we need to make to the persistence layer is updating the hydrators to work
with Doctrine. Doctrine handles the actual hydration pretty well. In fact, we don’t need the


Doctrine 2
208
InvoiceHydrator
anymore. We can go ahead and delete that, which means we can also delete
the
DateStrategy
strategy we built.
We’ll also make some updates to the
OrderHydrator
, first starting with the specs:
// specs/hydrator/order.spec.php

Download 2,26 Mb.

Do'stlaringiz bilan baham:
1   ...   166   167   168   169   170   171   172   173   ...   179




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish