Improve collection reference caching and remove legacy maps

This commit is contained in:
Thibaud Fabre
2015-07-10 18:39:36 +02:00
parent fcb369486a
commit d8f498aa26
12 changed files with 238 additions and 68 deletions

View File

@@ -54,7 +54,16 @@ class ArrayCacheCollectionRepository implements CollectionRepository
$this->collectionRepository->save($collection);
if ($this->collectionCache !== null) {
$this->collectionCache = null;
$this->collectionCache[$collection->getCollectionId()] = $collection;
}
}
public function delete(Collection $collection)
{
$this->collectionRepository->delete($collection);
if (isset($this->collectionCache[$collection->getCollectionId()])) {
unset($this->collectionCache[$collection->getCollectionId()]);
}
}
}