'type' => 'Locale',
'tab' => 'Settings']);
- $extranetv1 = ['settings', 'ws_password', 'ws_settings', 'ws_rights', 'ws_domains', 'login', 'mobile', 'fax', 'notes', 'grade','resetpassword'];
+ $extranetv1 = ['settings', 'ws_password', 'ws_settings', 'ws_rights', 'ws_domains', 'login', 'mobile', 'fax', 'notes', 'grade', 'resetpassword'];
foreach ($extranetv1 as $f) {
$this->addField(['name' => 'e1_' . $f,
protected static function _getCompanyNames($id = null)
{
- if (null === self::$_companyNames) {
- self::$_companyNames = Company::all()->pluck('name', 'id')->toArray();
- }
+ $cacheKey = '_get_compagny_names';
+ start_measure($cacheKey, 'Get compagny names');
+ self::$_companyNames = cache()->tags(['model_' . Company::class])->remember($cacheKey, 86400, function () {
+ return Company::all()->pluck('name', 'id')->toArray();
+ });
+ stop_measure($cacheKey);
if (null === $id) {
return self::$_companyNames;
}
+
return self::$_companyNames[$id];
}
public function getManagedUsers()
{
- return Permissions::getManagedUsers($this->id);
+ start_measure('_get_managed_users', 'Get managed users');
+ $res = Permissions::getManagedUsers($this->id);
+ stop_measure('_get_managed_users');
+ return $res;
}