Jump to content

Using a DB abstraction class in a different class?


Arty Ziff

Recommended Posts

Your first need to ensure that the database abstraction implements an interface that the other class understands. Then, simply instantiate the database class, and pass it to the other class via either a purpose build method, or the __construct, making sure you use type hinting to enforce the correct interface.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.