Jump to:

5450 Posts in 1672 Topics by 1197 members

Customising the CMS

SilverStripe Forums » Customising the CMS » External Database

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

Page: 1
Go to End
Author Topic: 1397 Views
  • geist
    Avatar
    Community Member
    7 Posts

    External Database Link to this post

    Following challenge:

    When creating an new Page, the data should be checked by the data of an external Database.

    Example:

    Silverstripe:

    public static $db = array(
    'EventDate' => 'Date',
    'EventName' => 'Text',
    'EventID' => 'Int',
    );

    $fields->addFieldToTab("Root.Content.Main", new TextField('EventDate','Date:'));
    $fields->addFieldToTab("Root.Content.Main", new TextField('EventName','Text:'));

    External Database:

    'eventDate' => 'Date',
    'eventName' => 'Text',
    'eventID' => 'Int',

    Bevore storing the data in SilverStripe I have to check, if SilverStripe.EventDate corresponds with an entry in external.eventDate and SilverStripe.EventName corresponds with an entry in external.eventName. If not, store the data in the external database and store the external.eventID in SilverStripe.EventID.

    Has anyone any idea?

    Cheers

    geist

  • geist
    Avatar
    Community Member
    7 Posts

    Re: External Database Link to this post

    onBeforeWrite... onBeforeDelete...

    Hi geist, first look to the documentation, then ask stupid questions...

    Cheers

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