mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 15:03:25 +00:00
fix DB collection cache (#4130)
This commit is contained in:
@@ -74,4 +74,10 @@ class ArrayCacheCollectionRepository implements CollectionRepository
|
|||||||
unset($this->collectionCache[$collection->getCollectionId()]);
|
unset($this->collectionCache[$collection->getCollectionId()]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function clearCache()
|
||||||
|
{
|
||||||
|
$this->collectionCache = null;
|
||||||
|
$this->collectionRepository->clearCache();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -91,15 +91,18 @@ final class CachedCollectionRepository implements CollectionRepository
|
|||||||
{
|
{
|
||||||
$this->repository->save($collection);
|
$this->repository->save($collection);
|
||||||
|
|
||||||
$cacheKey = $this->getCacheKey();
|
$this->clearCache();
|
||||||
|
|
||||||
$this->cache->delete($cacheKey);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function delete(Collection $collection)
|
public function delete(Collection $collection)
|
||||||
{
|
{
|
||||||
$this->repository->delete($collection);
|
$this->repository->delete($collection);
|
||||||
|
|
||||||
|
$this->clearCache();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function clearCache()
|
||||||
|
{
|
||||||
$cacheKey = $this->getCacheKey();
|
$cacheKey = $this->getCacheKey();
|
||||||
|
|
||||||
$this->cache->delete($cacheKey);
|
$this->cache->delete($cacheKey);
|
||||||
|
@@ -597,6 +597,9 @@ class collection implements ThumbnailedElement, cache_cacheableInterface
|
|||||||
$this->getReferenceRepository()->save($this->reference);
|
$this->getReferenceRepository()->save($this->reference);
|
||||||
$this->collectionRepositoryRegistry->purgeRegistry();
|
$this->collectionRepositoryRegistry->purgeRegistry();
|
||||||
|
|
||||||
|
// clear cached collection
|
||||||
|
$this->getCollectionRepository()->clearCache();
|
||||||
|
|
||||||
// clear the trivial cache of databox->get_collections()
|
// clear the trivial cache of databox->get_collections()
|
||||||
$this->get_databox()->clearCache(databox::CACHE_COLLECTIONS);
|
$this->get_databox()->clearCache(databox::CACHE_COLLECTIONS);
|
||||||
|
|
||||||
@@ -617,6 +620,9 @@ class collection implements ThumbnailedElement, cache_cacheableInterface
|
|||||||
$this->getReferenceRepository()->save($this->reference);
|
$this->getReferenceRepository()->save($this->reference);
|
||||||
$this->collectionRepositoryRegistry->purgeRegistry();
|
$this->collectionRepositoryRegistry->purgeRegistry();
|
||||||
|
|
||||||
|
// clear cached collection
|
||||||
|
$this->getCollectionRepository()->clearCache();
|
||||||
|
|
||||||
// clear the trivial cache of databox->get_collections()
|
// clear the trivial cache of databox->get_collections()
|
||||||
$this->get_databox()->clearCache(databox::CACHE_COLLECTIONS);
|
$this->get_databox()->clearCache(databox::CACHE_COLLECTIONS);
|
||||||
|
|
||||||
|
@@ -198,7 +198,7 @@
|
|||||||
<li>
|
<li>
|
||||||
<form class='form-inline' method="post" action="{{ path('admin_collection_enable', {'bas_id': baseId}) }}">
|
<form class='form-inline' method="post" action="{{ path('admin_collection_enable', {'bas_id': baseId}) }}">
|
||||||
{{ baseId|bas_labels(app) }}
|
{{ baseId|bas_labels(app) }}
|
||||||
<a href="#" class="btn btn-mini reload submiter">{{ "Activer" | trans }}></a>
|
<a href="#" class="btn btn-mini reload submiter">{{ "Activer" | trans }}</a>
|
||||||
</form>
|
</form>
|
||||||
</li>
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
Reference in New Issue
Block a user