From: Vincent Vanwaelscappel Date: Mon, 17 Jun 2019 14:03:01 +0000 (+0200) Subject: #2840 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=8f266da543653ae635987a26103dbbe603834e16;p=cubist_cms-back.git #2840 --- diff --git a/src/app/Magic/Fields/Model.php b/src/app/Magic/Fields/Model.php index 0bba065..7f4bf52 100644 --- a/src/app/Magic/Fields/Model.php +++ b/src/app/Magic/Fields/Model.php @@ -6,7 +6,7 @@ namespace Cubist\Backpack\app\Magic\Fields; class Model extends Field { - protected static $_options = null; + protected static $_options = []; public function getColumnData() { @@ -23,10 +23,12 @@ class Model extends Field protected function _getOptions() { - if (null === static::$_options) { - static::$_options = $this->__getOptions(); + $cacheKey = $this->getAttribute('name') . '-' . $this->getAttribute('optionsmodel'); + + if (!isset(static::$_options[$cacheKey])) { + static::$_options[$cacheKey] = $this->__getOptions(); } - return static::$_options; + return static::$_options[$cacheKey]; } protected function __getOptions()