Uh oh!
There was an error while loading. Please reload this page.
[5.x] Add fresh method to Blueprint & Fieldset classes - #11066
Closed
duncanmcclean wants to merge 2 commits into
Closed
[5.x] Add fresh method to Blueprint & Fieldset classes#11066duncanmcclean wants to merge 2 commits into
fresh method to Blueprint & Fieldset classes#11066duncanmcclean wants to merge 2 commits into
Conversation
jasonvarga
commented
Nov 6, 2024
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
commented
Nov 8, 2024
MemberAuthor
Oh, I hadn't thought of that. Fair enough! |
duncanmcclean
deleted the
add-fresh-method-to-blueprint-and-fieldset-classes
branch
November 8, 2024 12:07
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request implements a
freshmethod on theBlueprintandFieldsetclasses, making it easier to get the latest instance of a blueprint/fieldset.I also added a
fullyQualifiedHandlemethod to theBlueprintclass as the handle format differs depending on if it's a namespaced blueprint or not and whether it has anamespaceset or not. Feel free to rename this method if you can think of a better name 😄