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.

Data Model Questions /

Connecting to tables not managed by silverstripe


Reply


2 Posts   1247 Views

Avatar
scooch

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,
David

Avatar
Hamish

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.