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

[5.x] Add fresh method to Blueprint & Fieldset classes #11066

Closed

Conversation

duncanmcclean
Copy link
Member

This pull request implements a fresh method on the Blueprint and Fieldset classes, making it easier to get the latest instance of a blueprint/fieldset.

I also added a fullyQualifiedHandle method to the Blueprint class as the handle format differs depending on if it's a namespaced blueprint or not and whether it has a namespace set or not. Feel free to rename this method if you can think of a better name 😄

@jasonvarga
Copy link
Member

I haven't tested this but I don't think it's quite a great idea to have it. I think that if you use Blueprint::find(), the appropriate events won't get dispatched.

Like EntryBlueprintFound could be used to add fields. It only happens when you do something like $entry->blueprint().

If you did $blueprint->fresh() it would get a fresh blueprint without those fields.

Again, haven't tested so I might be wrong.

@duncanmcclean
Copy link
Member Author

Oh, I hadn't thought of that. Fair enough!

@duncanmcclean duncanmcclean deleted the add-fresh-method-to-blueprint-and-fieldset-classes branch November 8, 2024 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants