zend-framework2


zf2 composite model factory creation - FactoryInterface/Mapper?


I'm a bit mentally stuck when it comes to object creation in zf2.
I am using factory classes (implements FactoryInterface) for the servicemanager to create objects. The issue arises from composite objects $model = new ObjectA(new ObjectB(), new ObjectC()) that need populating, such as from the database.
Since objects' B and C are a dependency of A, should mappers for objects B and C also be dependencies of object A's mapper? eg. $modelMapper = new ObjectAMapper(new ObjectBMapper(), new ObjectCMapper())
Also, when it comes to the Mapper for object A finding and creating an object - should it call create methods on ObjectBMapper and ObjectCMapper?
Or how can i make the object creation separate from the mappers and use the FactoryInterface'd factory to return both populated and empty objects? I thought of passing the Factory into the Mapper but since FactoryInterface::createService requires a servicelocator interface i don't think it's the right place

Related Links

Zend Framework 2 ZF tool creating controller
Modules in zend framework 2
ZF2 An Invalid Factory Was Registered
How to show form drop down from database in Zend Framework 2.4.0?
Do zend framework has application setup wizard module?
Zend Framework 2 - How to give declare folder path in terms of “use” and “namespace”
Zend framework 2 session exists or not, in Module.php
Zend Framework 2 - Deploy proeject to web server
get all data from mysql query in zend 2
ZF2 optionally change user password in form
Vagrant + ZF2: vagrant not able to bring up ZF2 interface
Different layout for different module in zf2
'Zend\View\Renderer\PhpRenderer::render: Unable to render template “error”;
ZendF 2 form view helper escapes attributes
Get user's profile data after auth with SocalNick/ScnSocialAuth
delete parameters in URL

Categories

HOME
sidekiq
batch-processing
sass
payment-gateway
puzzle
filterrific
xamarin.android
warnings
youtube-livestreaming-api
ruby-on-rails-3
orientation
jpanel
vsftpd
internet-explorer-11
powershell-v3.0
image-recognition
cosmicmind
flat-file
zoho
device-detection
multiple-columns
jconsole
uiautomator
jquery-form-validator
memsql
delete-file
myob
searchbar
printdocument
data-cleansing
hanami
opencart2.3
skmaps
version-numbering
dss
classpath
pcre
multichoiceitems
cell-array
xor
getjson
svnkit
strophe
percentage
skygear
fabric-digits
salesforce-chatter
node-horseman
phpspreadsheet
superpowered
geomesa
hashcat
office365connectors
concrete5-5.7
fltk
xbim
tango
finite-element-analysis
jdbi
3scale
ajp
fqdn
proof
gauss
heroku-postgres
python-hypothesis
gmt
createobject
system.web.ui.webcontrols
android-navigationview
cron-task
mix
tomcat5
radians
bluesnap
acm
sonarqube5.3
java.util.calendar
android-viewholder
sem
fabric-twitter
python-winshell
built-in
pyrocms
castle-windsor-3
digits
isml
uos
code-first-migrations
adodb
ctrlp
jai
pisa
grunt-express
sthttprequest
codeigniter-a3m
indexing-service
initialization-vector
circos
modeshape
nsmatrix
astyanax
sttwitter
apache2.2
dynamics-ax-2009
fortran77
transitive-closure-table
sequelpro
ubuntu-11.10
symfony-2.0
objective-c-protocol
maven-ant-tasks
driving-directions
cross-domain-policy
handwriting
out-of-browser
msn
carbide
oggvorbis
longjmp
soft-keyboard
inline-if
database-diagramming
writing
cots

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App