Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

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

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

guid - globally unique identifier


Go to End


2 Posts   1104 Views

Avatar
Isidro

Community Member, 4 Posts

15 February 2013 at 5:23am

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?

Regards,
Rui Isidro

Avatar
Willr

Forum Moderator, 5523 Posts

16 February 2013 at 1:19pm

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()).