I’m still drinking the Ruby Kool Aid, but when I have to PHP in my own well:
class User extends AppModel
{
var $name = 'User';
var $primaryKey = 'user_id';
var $useDbConfig = 'alternate';
}
— Cake: easy as pie. Image may be NSFW.
Clik here to view.
class User extends ActiveRecord
{
function init ($attributes = array())
{
parent::init($attributes);
$this->setPrimaryKey('user_id');
}
function setConnection ($dsn = null, $connection_id = null)
{
$this->_db =& Ak::db('mysql://user:password@localhost/alternate', 'usersalt');
}
}
— Akelos: more like a PITA.