Changeset View
Changeset View
Standalone View
Standalone View
src/app/Domain.php
Show First 20 Lines • Show All 378 Lines • ▼ Show 20 Lines | public function isEmpty(): bool | ||||
$suffix = '@' . $this->namespace; | $suffix = '@' . $this->namespace; | ||||
$suffixLen = strlen($suffix); | $suffixLen = strlen($suffix); | ||||
return !( | return !( | ||||
\App\User::whereRaw('substr(email, ?) = ?', [-$suffixLen, $suffix])->exists() | \App\User::whereRaw('substr(email, ?) = ?', [-$suffixLen, $suffix])->exists() | ||||
|| \App\UserAlias::whereRaw('substr(alias, ?) = ?', [-$suffixLen, $suffix])->exists() | || \App\UserAlias::whereRaw('substr(alias, ?) = ?', [-$suffixLen, $suffix])->exists() | ||||
|| \App\Group::whereRaw('substr(email, ?) = ?', [-$suffixLen, $suffix])->exists() | || \App\Group::whereRaw('substr(email, ?) = ?', [-$suffixLen, $suffix])->exists() | ||||
|| \App\Resource::whereRaw('substr(email, ?) = ?', [-$suffixLen, $suffix])->exists() | || \App\Resource::whereRaw('substr(email, ?) = ?', [-$suffixLen, $suffix])->exists() | ||||
|| \App\SharedFolder::whereRaw('substr(email, ?) = ?', [-$suffixLen, $suffix])->exists() | |||||
); | ); | ||||
} | } | ||||
/** | /** | ||||
* Suspend this domain. | * Suspend this domain. | ||||
* | * | ||||
* @return void | * @return void | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 107 Lines • Show Last 20 Lines |