- Issue created by @erik.erskine
- Issue was unassigned.
- Status changed to Needs review
11 months ago 8:32am 15 May 2024 - πΈπͺSweden erik.erskine
erik.erskine β changed the visibility of the branch 3447272-add-cache-metadata to hidden.
- πΈπͺSweden erik.erskine
erik.erskine β changed the visibility of the branch 3447272-add-cache-metadata to hidden.
- πΈπͺSweden erik.erskine
erik.erskine β changed the visibility of the branch 3447272-add-cache-metadata to hidden.
- πΈπͺSweden erik.erskine
erik.erskine β changed the visibility of the branch 3447272-add-cache-metadata to active.
- Status changed to Needs work
11 months ago 9:46am 15 May 2024 - πΊπ¦Ukraine voleger Ukraine, Rivne
Wow, that's good to know. I suggest adding a protected method, `prepareValue(),` to the base plugin class, which will return an initiated cacheable string object instance.
- last update
11 months ago 2 fail - πΈπͺSweden erik.erskine
I suggest adding a protected method,
prepareValue()
, to the base plugin class, which will return an initiated cacheable string object instance.Hi @voleger. I don't quite understand this suggestion. What would be the difference between
prepareValue()
andgetValue()
? - πΊπ¦Ukraine voleger Ukraine, Rivne
I suggest adding an API to prepare the value (which includes a cache metadata wrapper) for plugin implementations. I just suggested the name of the method which provides that, so naming is open for discussion.
- πΈπͺSweden erik.erskine
Do you mean something like this?
abstract class GlobalVariable { protected $value; abstract function prepareValue(); function getValue() { if (empty($this->value)) { $this->prepareValue(); } return $this->value; } }
class MyVariable extends GlobalVariable { function prepareValue() { $this->value = new StringVariableValue('foo'); $this->value->addCacheableDependency($bar); } }