diff --git a/src/Selectoo.php b/src/Selectoo.php index 926d684..c00e46a 100644 --- a/src/Selectoo.php +++ b/src/Selectoo.php @@ -226,6 +226,22 @@ protected function isLoaded() } + /** + * Unload dynamically loaded items. + * + * Calling this method only makes sense when item callback is set. + * + * @return self + */ + public function unload() + { + if ($this->getItemCallback() !== null) { + $this->items = null; + } + return $this; + } + + protected function loadItems() { $callable = $this->getItemCallback();