Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Data Model Questions /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Connecting to tables not managed by silverstripe

Go to End

2 Posts   1572 Views


Community Member, 1 Post

19 June 2009 at 3:27am

We have a vbulletin database, all tables prefixed vb_ and would like to use data from these tables within the site. For example, latest forum threads on the homepage.
From what i can gather to use the silverstripe ORM the tables need to be in the correct format, ID be the primary key for instance.
Is there any way to override these field names so we can build classes for existing tables and work with them in silverstripe? Perhaps at the very least is there a raw sql method for using the same connections setup by the orm.
I'm new to silverstripe but used to using ORMs such as php doctrine. Any help would be much appreciated as we are in the process of deciding which framework/cms to use on a new project.

Kind Regards,


Community Member, 712 Posts

19 June 2009 at 10:30pm

You can get the current connection with DB::getConn() or return an SQL result from the current connection with DB::query($query_string), but you are right that you can't use the usual ORM niceness.