Skip to content

Commit

Permalink
unload
Browse files Browse the repository at this point in the history
  • Loading branch information
dakujem committed Jan 10, 2018
1 parent 617fee1 commit 7d1aca0
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/Selectoo.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 7d1aca0

Please sign in to comment.