Jump to:

3430 Posts in 1057 Topics by 734 members

Data Model Questions

SilverStripe Forums » Data Model Questions » Lock a DataObject's table against DDL updates

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

Page: 1
Go to End
Author Topic: 1159 Views
  • Judge
    Avatar
    Community Member
    79 Posts

    Lock a DataObject's table against DDL updates Link to this post

    If I want to point a DataObject at a third-party table (i.e. from another application running in the same space), is there something I can add to the DataObject to prevent SilverStripe from ever trying to change the structure of that table?

    -- Jason

  • Ingo
    Avatar
    Forum Moderator
    801 Posts

    Re: Lock a DataObject's table against DDL updates Link to this post

    We've written wrappers for DataObjects before, basically overloading __construct() and write(), although there's no real ORM support for custom table names, column mappings etc. You're probably best off writing a "table data gateway" pattern implementation (http://martinfowler.com/eaaCatalog/tableDataGateway.html) which acts similar to the SilverStripe ORM (implementing get(), get_one(), etc). If you extend the object class from ViewableData, you should be able to use a lot of it in a template context already.

  • Judge
    Avatar
    Community Member
    79 Posts

    Re: Lock a DataObject's table against DDL updates Link to this post

    Okay - thanks.

    -- Jason

    1159 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.