/** * Removes single object from pool and cache. * * @param string $key of the objects to be removed * * @return void */ public function deleteItem($key) { $this->cache->deleteItem($key); if (isset($this->keyToObj[$key])) { unset($this->keyToObj[$key]); } }
/** * Removes objects from pool and from cache, if the later is being used * * @param int &$ids of the objects to be removed * * @return void */ public function deleteFromCache(&$ids) { $c = $this->cache instanceof ICache; foreach ($ids as $id) { if (isset($this->idToObj[$id])) { unset($this->idToObj[$id]); } if ($c) { $this->cache->deleteItem($this->classNick . '_' . $id); } } }