Skip to content

Commit

Permalink
Merge pull request #10 from atravkovs/caching
Browse files Browse the repository at this point in the history
Added event on item collection data load
  • Loading branch information
alfredsgenkins committed Dec 18, 2019
2 parents 281ee7f + 54738a6 commit a2c1c73
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/Model/ResourceModel/Item/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,19 @@ public function toItemOptionArray()

return $result;
}

/**
* @return $this
*/
protected function _afterLoadData()
{
parent::_afterLoadData();

$collection = clone $this;
if (count($collection)) {
$this->_eventManager->dispatch('scandipwa_menuorganizer_item_collection_load_after', ['collection' => $collection]);
}

return $this;
}
}

0 comments on commit a2c1c73

Please sign in to comment.