class UserDisk extends Model

Traits

HasFactory

Constants

DCACHE_TOKEN_ENDPOINT

Endpoint URL for dCache token exchange and refresh.

TYPES

Map of type key to type name/description.

Properties

protected array $fillable

The attributes that are mass assignable.

protected array $casts

The attributes that should be cast.

Methods

static array
getConfigTemplate(string $type)

Return the storage disk config template associated with the disk type,

static array
getStoreValidationRules(string $type)

Return the validation rules to create a disk with a specific type.

static array
getUpdateValidationRules(string $type)

Return the validation rules to update a disk with a specific type.

bool
isAboutToExpire()

Check whether the disk is about to expire.

static Factory
newFactory()

Create a new factory instance for the model.

BelongsTo
user()

The user who owns the disk.

array
getConfig()

Get the filesystem disk configuration array of this user disk.

extend()

Extend the expiration date of the disk.

bool
isDCacheAccessTokenExpiring()

Check if the dcache access token is about to expire (within 1 minute) or already expired.

bool
isDCacheRefreshTokenExpiring()

Check if the dcache refresh token is about to expire (within 2 hours).

bool
refreshDCacheToken()

Refresh the dcache access and refresh tokens.

Details

at line 64
static array getConfigTemplate(string $type)

Return the storage disk config template associated with the disk type,

Parameters

string $type

Return Value

array

at line 76
static array getStoreValidationRules(string $type)

Return the validation rules to create a disk with a specific type.

Parameters

string $type

Return Value

array

at line 88
static array getUpdateValidationRules(string $type)

Return the validation rules to update a disk with a specific type.

Parameters

string $type

Return Value

array

at line 98
bool isAboutToExpire()

Check whether the disk is about to expire.

Return Value

bool

at line 108
static protected Factory newFactory()

Create a new factory instance for the model.

Return Value

Factory

at line 118
BelongsTo user()

The user who owns the disk.

Return Value

BelongsTo

at line 128
array getConfig()

Get the filesystem disk configuration array of this user disk.

Return Value

array

at line 138
extend()

Extend the expiration date of the disk.

at line 149
bool isDCacheAccessTokenExpiring()

Check if the dcache access token is about to expire (within 1 minute) or already expired.

Return Value

bool

at line 169
bool isDCacheRefreshTokenExpiring()

Check if the dcache refresh token is about to expire (within 2 hours).

Return Value

bool

at line 189
bool refreshDCacheToken()

Refresh the dcache access and refresh tokens.

Return Value

bool

True if the refresh was successful, false otherwise