'type' => Integer::class,
'tab' => __('Chiffres'),
'column' => true,
- 'read_only'=>true]);
+ 'read_only' => true]);
$extranetv1 = ['settings', 'ws_password', 'ws_settings', 'ws_rights', 'ws_domains', 'ws_count', 'login', 'mobile', 'fax', 'notes', 'resetpassword'];
protected static function _getCompanyNames($id = null)
{
- $cacheKey = '_get_compagny_names';
- start_measure($cacheKey, 'Get compagny names');
- self::$_companyNames = cache()->tags(['model_' . Company::class])->remember($cacheKey, 86400, function () {
- set_time_limit(0);
- $res = Company::withoutGlobalScopes()->get();
- return $res->pluck('name', 'id')->toArray();
- });
- stop_measure($cacheKey);
+ if (null === self::$_companyNames) {
+ $cacheKey = '_get_compagny_names';
+ start_measure($cacheKey, 'Get compagny names');
+ self::$_companyNames = cache()->tags(['model_' . Company::class])->remember($cacheKey, 86400, function () {
+ set_time_limit(0);
+ $res = Company::withoutGlobalScopes()->get();
+ return $res->pluck('name', 'id')->toArray();
+ });
+ stop_measure($cacheKey);
+ }
if (null === $id) {
return self::$_companyNames;
}