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 Custom elements using ServiceManager not work
zend framework 2 gettext translation using others comments
How to pass arrays in ZF2 routes?
Image slider in layout
display multiple forms in one page [closed]
Zend framework 2 database relations
ZF2 An alias “translator” was requested but no service could be found. error on creating new skeleton project
How to set db adapter to Validator NoRecordExists and use it in controller?
Is there a way to add a log writer factory into the logger configuration?
zf2 make a join between two different databases
How to apply classes to labels using Zend\Form and add line endings within the rendered form?
Include js and css in ZF2 using AJAX or not
How to access custom view helper in a partial?
Where is the ServiceManager object initialized in the Zend Framework 2 User Guide?
Zend Framework 2 - Hide login link when logged in and vice versa for logout
ZF2 Route with Colon Separator

Categories

HOME
facebook-graph-api
youtube-livestreaming-api
chaiscript
laravel-4
xtext
devstack
spring-cloud-contract
i2c
actionscript-2
goutte
aruco
height
wordpress-theming
mongodb-query
x-frame-options
scala-native
ssms-2016
factor-analysis
grub2
google-api-java-client
kadanes-algorithm
jconsole
dspic
go-cd
azure-servicebus-queues
yosys
hanami
onesignal
unpack
web-frontend
weinre
cortex-m3
forum
devforce
jackson-dataformat-csv
referenceerror
smart-mobile-studio
spring-insight
geo
pljson
modulo
rhino
large-data
precedence
sonarqube-scan
agent
flex4.5
common.logging
bayesian-networks
microdata
constants
service-fabric-stateful
median
stress-testing
z3py
startapp
nsjsonserialization
sgmlreader
goquery
bnd
rpostgresql
launch
date-range
coremidi
spring-ioc
mix
git-annex
try-finally
contour
multinomial
optionbutton
ninject.web.mvc
rad
uialertview
stream-framework
viper-architecture
twitter-rest-api
swift2.1
subversion-edge
virus
jython-2.7
multipleselection
ctrlp
ejabberd-saas
proximity
adcolony
google-admin-audit-api
android-looper
baucis
ftp4j
ienumerator
apache2.2
transitive-closure-table
ubuntu-11.10
ajax.beginform
ihttphandler
pivotal-crm
mvccontrib-grid
idictionary
visual-c++-2008-express
asp.net-mvc-controller

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