Using $prefix
in Query.php
#114
Unanswered
spencerfinnell
asked this question in
Q&A
Replies: 1 comment 1 reply
-
This variable detail definitely should be made better soon. It's pretty confusing. The For Sugar Calendar the Obviously though, this requires hard-coding a change into Berlin because you can't extend 2 classes at once. See #103. Would love ideas on how to make this super easy. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
After noticing
Query::set_prefix()
I figured it would be a good idea to define aQuery::$prefix
property in my class that inherits theQuery
base. However, upon doing so I started seeing unexpected results.After investigating it looks like it's possible to end up with shared cache groups because
Base::apply_prefix()
will see the::$prefix
property and then try to apply that to the empty passed string which comes from the default emptyQuery::$cache_group
. Basically you getmy-prefix-
for every group name.Explicitly defining the
Query::$cache_group
property resolved my issue but I'm wondering if there is a good place to document that both are needed if used, or if the parent class should throw an exception if there is a set prefix with no cache group?Beta Was this translation helpful? Give feedback.
All reactions