Jump to:

7940 Posts in 1543 Topics by 946 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » Get info from another module table

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Page: 1
Go to End
Author Topic: 703 Views
  • ud2013
    Avatar
    Community Member
    6 Posts

    Get info from another module table Link to this post

    I am building several custom modules, what I would like to know, is it possible to get certain info from a table which belongs to another module? If so, how?

    For example:

    I have a module (module1) which holds info of a number of companies, now another module (module2) needs certain info from that other module (module1) and use it in the other module (module2). In module1, I wish to use the url of the company. Can I get that url and add it to module2?

    Thanks.

  • Willr
    Avatar
    Forum Moderator
    5511 Posts

    Re: Get info from another module table Link to this post

    All your websites modules get added to the same database as well as all the classes to the manifest, so yes you can call code which depends on other modules or extend them in particular ways.

    So in your example, your module 1 may have a DataObject defined for 'Company' your module 2 can get all those companies by doing $companies = Company::get(); in PHP code. SilverStripe handles finding the correct classes, tables etc for you.

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