Changeset View
Changeset View
Standalone View
Standalone View
src/app/User.php
Show First 20 Lines • Show All 376 Lines • ▼ Show 20 Lines | public function isDegraded(bool $owner = false): bool | ||||
if ($owner && ($wallet = $this->wallet())) { | if ($owner && ($wallet = $this->wallet())) { | ||||
return $wallet->owner && $wallet->owner->isDegraded(); | return $wallet->owner && $wallet->owner->isDegraded(); | ||||
} | } | ||||
return false; | return false; | ||||
} | } | ||||
/** | /** | ||||
* Storage files for this user. | |||||
* | |||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany | |||||
*/ | |||||
public function files() | |||||
{ | |||||
return $this->hasMany(Fs\File::class); | |||||
} | |||||
/** | |||||
* A shortcut to get the user name. | * A shortcut to get the user name. | ||||
* | * | ||||
* @param bool $fallback Return "<aa.name> User" if there's no name | * @param bool $fallback Return "<aa.name> User" if there's no name | ||||
* | * | ||||
* @return string Full user name | * @return string Full user name | ||||
*/ | */ | ||||
public function name(bool $fallback = false): string | public function name(bool $fallback = false): string | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 317 Lines • Show Last 20 Lines |