Skip to content
This repository has been archived by the owner on Aug 22, 2023. It is now read-only.

PHPORM-29: Add classes to cast ObjectId and UUID instances #1

Merged
merged 1 commit into from
Jun 29, 2023

Conversation

alcaeus
Copy link
Collaborator

@alcaeus alcaeus commented Jun 28, 2023

This adds classes to cast ObjectIds and binary UUIDs to strings and vice-versa.

I've also added a test to confirm that casts are not applied when querying. While unfortunate, there's no way to add this functionality to Laravel as casting isn't exposed the way we need to cast in queries.

@alcaeus alcaeus self-assigned this Jun 28, 2023
@alcaeus alcaeus force-pushed the bson-casts branch 2 times, most recently from 96e9f4a to eb3d4df Compare June 29, 2023 08:42
@alcaeus alcaeus changed the title (WIP) PHPORM-29: Add classes to cast ObjectId and UUID instances PHPORM-29: Add classes to cast ObjectId and UUID instances Jun 29, 2023
@alcaeus alcaeus requested a review from GromNaN June 29, 2023 08:42
Copy link
Owner

@GromNaN GromNaN left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@alcaeus alcaeus merged commit b6e8a44 into master Jun 29, 2023
@alcaeus alcaeus deleted the bson-casts branch June 29, 2023 10:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants