mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-15 14:03:27 +00:00
- add some simple cache
- disable check of conf/searchengine/type - faster construction of concept-paths - pass strucure to es as factory (useless, to be reverted) - add stopwatch (log into file, disabled for now)
This commit is contained in:
@@ -581,13 +581,17 @@ class databox extends base implements ThumbnailedElement
|
||||
*/
|
||||
public function get_collection_unique_ids()
|
||||
{
|
||||
$collectionsIds = [];
|
||||
static $_r = null;
|
||||
|
||||
foreach ($this->get_collections() as $collection) {
|
||||
$collectionsIds[] = $collection->get_base_id();
|
||||
if($_r === null) {
|
||||
$_r = [];
|
||||
|
||||
foreach ($this->get_collections() as $collection) {
|
||||
$_r[] = $collection->get_base_id();
|
||||
}
|
||||
}
|
||||
|
||||
return $collectionsIds;
|
||||
return $_r;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -595,13 +599,19 @@ class databox extends base implements ThumbnailedElement
|
||||
*/
|
||||
public function get_collections()
|
||||
{
|
||||
/** @var CollectionRepositoryRegistry $repositoryRegistry */
|
||||
$repositoryRegistry = $this->app['repo.collections-registry'];
|
||||
$repository = $repositoryRegistry->getRepositoryByDatabox($this->get_sbas_id());
|
||||
static $_r = null;
|
||||
|
||||
return array_filter($repository->findAll(), function (collection $collection) {
|
||||
return $collection->is_active();
|
||||
});
|
||||
if($_r === null) {
|
||||
/** @var CollectionRepositoryRegistry $repositoryRegistry */
|
||||
$repositoryRegistry = $this->app['repo.collections-registry'];
|
||||
$repository = $repositoryRegistry->getRepositoryByDatabox($this->get_sbas_id());
|
||||
|
||||
$_r = array_filter($repository->findAll(), function (collection $collection) {
|
||||
return $collection->is_active();
|
||||
});
|
||||
}
|
||||
|
||||
return $_r;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user