I'd say refactor the code to use service manager and all of the sudden it would be all clear to you. Btw how does your static method act as - as factory?
Matus On Wed, Sep 19, 2012 at 12:25 PM, elk <[email protected]> wrote: > Hello everyone, > > could you please point me to the right direction with this issue? Let me > briefly describe the situation. From my previous project I've got a few > classes (CLASS_A, CLASS_B, ...) I want to reuse. I grouped them into a > Module. > > 1) In a controller (in another Module), I call a static method of CLASS_A. > 2) This method creates an object of CLASS_B and calls its methods. > 3) Methods of CLASS_B need a database connection. > > What would be the best way to archieve this. So far I tried many things, > but > none did the trick. I just cant find a way, how to get the database > connection into Class_B and call its methods from static method of the > Class_A ... > > > > > > -- > View this message in context: > http://zend-framework-community.634137.n4.nabble.com/Inject-db-connection-into-not-zend-libraries-tp4656927.html > Sent from the Zend Framework mailing list archive at Nabble.com. > > -- > List: [email protected] > Info: http://framework.zend.com/archives > Unsubscribe: [email protected] > > >
