Abstract some of the logic in Entry::getSupportedSites #16180
Unanswered
ryansupercool
asked this question in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When implementing a custom Element that supports propagation we find ourselves duplicating the logic within
Entry::getSupportedSites
. We only typically just follow what Craft does here in terms of the supported methods. Craft Commerce does the same thing and duplicates the logic inEntry::getSupportedSites
. I assume other developers also typically follow this when supporting propagation.Could some of this logic be abstracted into a helper? Maybe something like the following.
The helper would then look like this and take two arguments, the propagation method and an array of
SiteSettings
models. SiteSettings being a new base class that hassiteId
andenabledByDefault
properties.Beta Was this translation helpful? Give feedback.
All reactions