Fix failing enable/disable collection tests

This commit is contained in:
Vagrant User
2016-01-07 17:02:20 +01:00
parent 921a32034a
commit bf524dac0c
3 changed files with 72 additions and 48 deletions

View File

@@ -178,17 +178,13 @@ class databox extends base implements ThumbnailedElement
*/
public function get_collections()
{
static $collections;
/** @var CollectionRepositoryRegistry $repositoryRegistry */
$repositoryRegistry = $this->app['repo.collections-registry'];
$repository = $repositoryRegistry->getRepositoryByDatabox($this->get_sbas_id());
if ($collections === null) {
/** @var CollectionRepositoryRegistry $repositoryRegistry */
$repositoryRegistry = $this->app['repo.collections-registry'];
$repository = $repositoryRegistry->getRepositoryByDatabox($this->get_sbas_id());
$collections = $repository->findAll();
}
return $collections;
return array_filter($repository->findAll(), function (collection $collection) {
return $collection->is_active();
});
}
/**