Jump to:

3372 Posts in 998 Topics by 712 members

Data Model Questions

SilverStripe Forums » Data Model Questions » Connecting to tables not managed by silverstripe

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

Page: 1
Go to End
Author Topic: 1132 Views
  • scooch
    Avatar
    Community Member
    1 Post

    Connecting to tables not managed by silverstripe Link to this post

    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

  • Hamish
    Avatar
    Community Member
    712 Posts

    Re: Connecting to tables not managed by silverstripe Link to this post

    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.

    1132 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.