Jump to:

3372 Posts in 998 Topics by 712 members

Data Model Questions

SilverStripe Forums » Data Model Questions » Extending DataObject

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

Page: 1
Go to End
Author Topic: 1111 Views
  • imihai
    Avatar
    Community Member
    2 Posts

    Extending DataObject Link to this post

    Hi guys, just wanting to congratulate you on the great job so far, and I only have just one question related to DataObject extensions :
    I am currently developing a module which requires quite a lot of tables (15 or more) and I thought that Extending DataObject would be the best way to do it so I went on and defined my classes in the modules _config.php, now, is that the best way to do it because this Undefined index error in sapphire/core/ClassInfo.php (ancestry) keep popping up when least expected and I`m really out of ideas. Any help would be greatly appreciated.

  • chrclaus
    Avatar
    Community Member
    29 Posts

    Re: Extending DataObject Link to this post

    Hi imihai,

    You have to register your extensions and the best place is - from my current point of view - in the _config.php.

    I gained the experiences, that creating the extension classes and insert the extension-registration in the _config.php in one step does not work. I found a solution with commenting the registration entries in _config.php and run a db/build?flush=1, uncommenting and run a db/build again. I did not find any reason for the steps, but it works.

    Best regards,
    chrclaus

  • imihai
    Avatar
    Community Member
    2 Posts

    Re: Extending DataObject Link to this post

    No luck there ,

  • Hamish
    Avatar
    Community Member
    712 Posts

    Re: Extending DataObject Link to this post

    No, _config.php is for module configuration and acts as a flag to tell SilverStripe that a module extists at this location.

    Put your class files in the 'code' subdirectory under _config.php.

    See Creating Modules in the wiki.

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