芝麻web文件管理V1.00
编辑当前文件:/home/pulsehostuk9/public_html/cloud.pulsehost.co.uk/modules/Core/Models/User.php
$Groups * @property-read int|null $groups_count * @property-read mixed $entity_id * @property-read Tenant|null $parent * @method static \Illuminate\Database\Eloquent\Builder|\Aurora\Modules\Core\Models\User firstWhere(Closure|string|array|\Illuminate\Database\Query\Expression $column, mixed $operator = null, mixed $value = null, string $boolean = 'and') * @method static \Illuminate\Database\Eloquent\Builder|User newModelQuery() * @method static \Illuminate\Database\Eloquent\Builder|User newQuery() * @method static \Illuminate\Database\Eloquent\Builder|User query() * @method static \Illuminate\Database\Eloquent\Builder|\Aurora\Modules\Core\Models\User where(Closure|string|array|\Illuminate\Database\Query\Expression $column, mixed $operator = null, mixed $value = null, string $boolean = 'and') * @method static \Illuminate\Database\Eloquent\Builder|User whereAnswer1($value) * @method static \Illuminate\Database\Eloquent\Builder|User whereAnswer2($value) * @method static \Illuminate\Database\Eloquent\Builder|User whereCapa($value) * @method static \Illuminate\Database\Eloquent\Builder|User whereCreatedAt($value) * @method static \Illuminate\Database\Eloquent\Builder|User whereCustomFields($value) * @method static \Illuminate\Database\Eloquent\Builder|User whereDateFormat($value) * @method static \Illuminate\Database\Eloquent\Builder|User whereDefaultTimeZone($value) * @method static \Illuminate\Database\Eloquent\Builder|User whereDesktopNotifications($value) * @method static \Illuminate\Database\Eloquent\Builder|User whereEmailNotification($value) * @method static \Illuminate\Database\Eloquent\Builder|User whereFilesEnable($value) * @method static \Illuminate\Database\Eloquent\Builder|User whereId($value) * @method static \Illuminate\Database\Eloquent\Builder|User whereIdSubscription($value) * @method static \Illuminate\Database\Eloquent\Builder|User whereIdTenant($value) * @method static \Illuminate\Database\Eloquent\Builder|\Aurora\Modules\Core\Models\User whereIn(string $column, mixed $values, string $boolean = 'and', bool $not = false) * @method static \Illuminate\Database\Eloquent\Builder|User whereIsDisabled($value) * @method static \Illuminate\Database\Eloquent\Builder|User whereLanguage($value) * @method static \Illuminate\Database\Eloquent\Builder|User whereLastLogin($value) * @method static \Illuminate\Database\Eloquent\Builder|User whereLastLoginNow($value) * @method static \Illuminate\Database\Eloquent\Builder|User whereLoginsCount($value) * @method static \Illuminate\Database\Eloquent\Builder|User whereName($value) * @method static \Illuminate\Database\Eloquent\Builder|User wherePasswordResetHash($value) * @method static \Illuminate\Database\Eloquent\Builder|User whereProperties($value) * @method static \Illuminate\Database\Eloquent\Builder|User wherePublicId($value) * @method static \Illuminate\Database\Eloquent\Builder|User whereQuestion1($value) * @method static \Illuminate\Database\Eloquent\Builder|User whereQuestion2($value) * @method static \Illuminate\Database\Eloquent\Builder|User whereRole($value) * @method static \Illuminate\Database\Eloquent\Builder|User whereSipEnable($value) * @method static \Illuminate\Database\Eloquent\Builder|User whereSipImpi($value) * @method static \Illuminate\Database\Eloquent\Builder|User whereSipPassword($value) * @method static \Illuminate\Database\Eloquent\Builder|User whereTimeFormat($value) * @method static \Illuminate\Database\Eloquent\Builder|User whereTokensValidFromTimestamp($value) * @method static \Illuminate\Database\Eloquent\Builder|User whereUUID($value) * @method static \Illuminate\Database\Eloquent\Builder|User whereUpdatedAt($value) * @method static \Illuminate\Database\Eloquent\Builder|User whereWriteSeparateLog($value) * @method static \Illuminate\Database\Eloquent\Builder|\Aurora\Modules\Core\Models\User find(int|string $id, array|string $columns = ['*']) * @method static int count(string $columns = '*') * @method static \Illuminate\Database\Eloquent\Builder|\Aurora\Modules\Core\Models\User findOrFail(int|string $id, mixed $id, Closure|array|string $columns = ['*'], Closure $callback = null) * @method static \Illuminate\Database\Eloquent\Builder|\Aurora\Modules\Core\Models\User first(array|string $columns = ['*']) * @mixin \Eloquent */ class User extends Model { protected $table = 'core_users'; protected $moduleName = 'Core'; protected $parentType = Tenant::class; protected $parentKey = 'IdTenant'; protected $parentInheritedAttributes = [ ]; protected $foreignModel = Tenant::class; protected $foreignModelIdColumn = 'IdTenant'; // Column that refers to an external table /** * The attributes that are mass assignable. * * @var array */ protected $fillable = [ 'Id', 'UUID', 'Name', 'PublicId', 'IdTenant', 'IsDisabled', 'IdSubscription', 'Role', 'LastLogin', 'LastLoginNow', 'LoginsCount', 'Language', 'TimeFormat', 'DateFormat', 'Question1', 'Question2', 'Answer1', 'Answer2', 'SipEnable', 'SipImpi', 'SipPassword', 'DesktopNotifications', 'Capa', 'CustomFields', 'FilesEnable', 'EmailNotification', 'PasswordResetHash', 'WriteSeparateLog', 'DefaultTimeZone', 'TokensValidFromTimestamp', 'Properties', 'Note', ]; /** * @var array * */ protected $validationRules = [ 'TimeFormat' => 'in:0,1', ]; /** * @var array */ protected $validationMessages = [ 'TimeFormat.in' => 'User model validation error, rule: TimeFormat' ]; /** * The attributes that should be hidden for arrays. * * @var array */ protected $hidden = [ ]; protected $casts = [ 'Properties' => 'array', 'IsDisabled' => 'boolean', 'SipEnable' => 'boolean', 'DesktopNotifications' => 'boolean', 'FilesEnable' => 'boolean', 'WriteSeparateLog' => 'boolean', 'LastLogin' => 'datetime' ]; protected $attributes = [ ]; /** * Checks if a user is a superadmin. * * return bool */ public function isAdmin() { return $this->Id === -1; } /** * Checks if a user can act as a regular user. * * return bool */ public function isNormalOrTenant() { return $this->Role === \Aurora\System\Enums\UserRole::NormalUser || $this->Role === \Aurora\System\Enums\UserRole::TenantAdmin; } /** * Returns array of groups the user is related to. * * return array */ public function Groups() { return $this->belongsToMany(Group::class, 'core_group_user', 'UserId', 'GroupId'); } }