public static function bas_labels($base_id, Application $app) { if (!self::$_bas_labels) { try { self::$_bas_labels = $app->getApplicationBox()->get_data_from_cache(self::CACHE_BAS_LABELS); } catch (\Exception $e) { foreach ($app->getDataboxes() as $databox) { foreach ($databox->get_collections() as $collection) { self::$_bas_labels[$collection->get_base_id()] = ['fr' => $collection->get_label('fr'), 'en' => $collection->get_label('en'), 'de' => $collection->get_label('de'), 'nl' => $collection->get_label('nl')]; } } $app->getApplicationBox()->set_data_to_cache(self::$_bas_labels, self::CACHE_BAS_LABELS); } } if (isset(self::$_bas_labels[$base_id]) && isset(self::$_bas_labels[$base_id][$app['locale']])) { return self::$_bas_labels[$base_id][$app['locale']]; } return 'Unknown collection'; }