]> _ Git - cubist_cms-back.git/commitdiff
#2840
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 17 Jun 2019 14:03:01 +0000 (16:03 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 17 Jun 2019 14:03:01 +0000 (16:03 +0200)
src/app/Magic/Fields/Model.php

index 0bba06502387f84d1c18772d1a7f4f49c2d9c652..7f4bf5218570d94223557fd4a61a0b26e77ffd2b 100644 (file)
@@ -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()