Skip to content

Commit f1c7040

Browse files
committed
Added cache to subwidgets
1 parent a518fc7 commit f1c7040

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Fields/BoundField.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class BoundField
1313
private $form;
1414
private $field;
1515
private $name;
16+
private $subwidgets_cache;
1617

1718
public $html_name;
1819
public $help_text;
@@ -57,7 +58,10 @@ public function __get($name)
5758
}
5859

5960
if ($name == 'choices') {
60-
return $this->getSubWidgets();
61+
if (!isset($subwidgets_cache)) {
62+
$subwidgets_cache = $this->getSubWidgets();
63+
}
64+
return $subwidgets_cache;
6165
}
6266

6367
return parent::__get($name);

0 commit comments

Comments
 (0)