Jump to:

23490 Posts in 18996 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » guid - globally unique identifier

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1
Go to End
Author Topic: 369 Views
  • Isidro
    Community Member
    4 Posts

    guid - globally unique identifier Link to this post

    I'm working in a project that uses a mobile app with data that must be sinchronized with a database in SS (few dataobjects).

    In my mobile app, data records use globally unique identifiers as Ids, so i need to define dataobjects in SS also with guids. Can we change SS dataobject behaviour to use guids instead of integers as ID fields? What's the best field type in SS to store guids?

    Has anyone used this datafields that would like to share some experience?

    Rui Isidro

  • Willr
    Forum Moderator
    5508 Posts

    Re: guid - globally unique identifier Link to this post

    Replacing the primary ID in DataObject is likely to be very hard and messy in core. You're best to store the GUID as a new column and simply writing your queries to use that rather than ID field (you can populate the GUID using onBeforeWrite()).

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.