Jump to:

3460 Posts in 1064 Topics by 739 members

Data Model Questions

SilverStripe Forums » Data Model Questions » Fetch old versions in relations

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

Page: 1
Go to End
Author Topic: 328 Views
  • zard
    Avatar
    Community Member
    23 Posts

    Fetch old versions in relations Link to this post

    Hi!

    I am creating a database of booking, where I need the ability to link older versions of objects (hotels and their data) to history of bookings - at this moment, I am successfully capturing whole history using:

    Object::add_extension('PhysicalLocation', 'Versioned("Live")');

    This works well - however, is there a way to "force" also all relations (which are all Versioned too) to return with a version corresponding to that object? My idea of the "restriction" is that the relevant record should be the latest found in version history which still has modified date older than (or equal to) the parent fetching it - this would ensure that I would always get a snapshot for that time instead of latest (and no longer relevant) data.

  • zard
    Avatar
    Community Member
    23 Posts

    Re: Fetch old versions in relations Link to this post

    Nobody finds this useful?

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