You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The AbstractSource model contains a protected attribute $_options that is meant to cache the options. Unfortunately this is not enforced, instead each implementation of getAllOptions() is responsible to use that cache properly.
Reason
EAV source models often load possible values for attributes from external resources. Every access to those values, e.g. with $product->getAttributeText() calls getAllOptions() on the source model. The result of this method should only be calculated once.
Implementation
Any class that extends the abstract source model should return $this->_options in getAllOptions()
The text was updated successfully, but these errors were encountered:
Rule
The
AbstractSource
model contains a protected attribute$_options
that is meant to cache the options. Unfortunately this is not enforced, instead each implementation ofgetAllOptions()
is responsible to use that cache properly.Reason
EAV source models often load possible values for attributes from external resources. Every access to those values, e.g. with
$product->getAttributeText()
callsgetAllOptions()
on the source model. The result of this method should only be calculated once.Implementation
Any class that extends the abstract source model should
return $this->_options
ingetAllOptions()
The text was updated successfully, but these errors were encountered: