/** * @param string $itemId * @param string|null $collection */ public function delete($itemId, $collection = null) { $item = $this->_itemManager->get($itemId, $collection); if ($item) { $this->_itemManager->delete($item, $collection); $this->_recommender->onDelete($item); } }
/** * @param Item $item */ public function onDelete(Item $item) { $this->im->getRepository()->removeAllSimilarReferencesForItem($item); $this->dm->clear(); }