Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NEW: Adding getTableForField(): Ability to infer the actual DataObject that a particular field lives on (at runtime). #14

Merged
merged 1 commit into from
Aug 17, 2021

Conversation

patricknelson
Copy link
Owner

Adding getTableForField(): Ability to infer the actual DataObject that a particular field lives on (at runtime).

…t that a particular field lives on (at runtime).
@patricknelson patricknelson force-pushed the hotfix-get-table-for-field branch from 2c99753 to 23799dd Compare August 17, 2021 03:02
@patricknelson patricknelson merged commit 16397ed into master Aug 17, 2021
@patricknelson patricknelson deleted the hotfix-get-table-for-field branch August 17, 2021 03:04
@michalkleiner
Copy link

https://github.com/silverstripe/silverstripe-framework/blob/4/src/ORM/DataObjectSchema.php#L682 already exists in the framework, so no need to implement it through a custom code, @patricknelson.

$table = DataObjectSchema::singleton()->tableForField($class, $field);

@patricknelson
Copy link
Owner Author

patricknelson commented Aug 17, 2021

This module is only officially compatible with the outdated SilverStripe v3, however: We should add an issue to address this when we eventually upgrade this module to SS v4. 🙂

@patricknelson
Copy link
Owner Author

Then again I could just remove this method since I don’t use it myself and there’s no sense in creating an API that would need to break after upgrade. 🤔 I originally just added it to keep the code but move it out of my custom site codebase.

@patricknelson
Copy link
Owner Author

patricknelson commented Aug 17, 2021

I think it’s too late for that now. @michalkleiner, I actually didn’t realize anyone was actually using this module still. I’ll avoid breaking changes and just strip it out in v4 update (or v1 of this module). Sorry for the confusion!

@michalkleiner
Copy link

Ah, right, didn't realise it wasn't SS4 compatible. We don't actively use it, I'm just watching ;-)

@patricknelson
Copy link
Owner Author

I still use it regularly and definitely plan on eventually migrating it to SS v4 when I can finally get my site to that point. It’ll be a long path since it’s a huge site, but it’s definitely happening. Eventually… 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants