Skip to content
Ryan Fischbach edited this page Jul 7, 2015 · 3 revisions

Models all share a common ancestry and a single Model class can only talk to one db connection as standard practice. However, there is a built-in mechanism to change what connection to use.

Using different connection credentials

In order to use a db connection that is different from the one where the "webapp" is being used, create your inherited Model class and then change the const dbConnName = 'webapp'; to some other name, e.g. 'bob'. In your config folder (app/config/localhost for a localhost dev machine), copy the dbconn-webapp.ini file and name the copy as dbconn-bob.ini. Open that file up and change the credentials to what you need for the alternate db connection. Once you save the file, your model class will automatically connect using the credentials stored in dbconn-bob.ini and the Director class will automatically handle keeping track of the connection and sharing with any other Model class that may require it. Look in the app\DbConnInfo class for additional properties and methods you have access to via the Model::myDbConnInfo property.

Framework Database Schema

The framework cannot exist without a minimal set of database tables. The diagram displays the tables the website will use.

Clone this wiki locally