Thanks for the reply :) I've received no answers on any question regarding
ZF2 on stackoverflow or here so it's pretty hard to figure out things like I
used to for ZF1. Information is scarse! :D

I've basically got a TableRow design for a bit of my application. I have
buildings in a game and all their data is kept inside the database like
their name, type, costs etc.

So I pretty much have a dumb Building model that holds all the data and then
my BuildingMapper fetches the data from the database and returns the filled
Building model.

When you register to the game you a starting building created for you inside
your town. So I was using the BuildingMapper inside my UserMapper class to
create it. That's pretty much why it's not used directly in the controller
as its not directly needed there.

So I have in my DI all the stuff I thought would inject the dependencies and
I thought it would work something like this:

Controller needs UserMapper. 
UserMapper needs UserTable, BuildingMapper
BuildingMapper needs BuildingTable.

Then I thought as stuff was needed, they all had their dependencies injected
as the point they were called :)

How would I go about giving my BuildingMapper class the Table? I'm already
passing the Table it's connection.

Thanks :)

--
View this message in context: 
http://zend-framework-community.634137.n4.nabble.com/ZF2-DI-into-Models-not-directly-within-a-controller-tp4113674p4123634.html
Sent from the Zend Framework mailing list archive at Nabble.com.

-- 
List: [email protected]
Info: http://framework.zend.com/archives
Unsubscribe: [email protected]


Reply via email to