Changeset View
Changeset View
Standalone View
Standalone View
src/app/Resource.php
Show All 39 Lines | class Resource extends Model | ||||
// public const STATUS_SUSPENDED = 1 << 2; | // public const STATUS_SUSPENDED = 1 << 2; | ||||
// resource has been deleted | // resource has been deleted | ||||
public const STATUS_DELETED = 1 << 3; | public const STATUS_DELETED = 1 << 3; | ||||
// resource has been created in LDAP | // resource has been created in LDAP | ||||
public const STATUS_LDAP_READY = 1 << 4; | public const STATUS_LDAP_READY = 1 << 4; | ||||
// resource has been created in IMAP | // resource has been created in IMAP | ||||
public const STATUS_IMAP_READY = 1 << 8; | public const STATUS_IMAP_READY = 1 << 8; | ||||
/** @var int The allowed states for this object used in StatusPropertyTrait */ | |||||
private int $allowed_states = self::STATUS_NEW | | |||||
self::STATUS_ACTIVE | | |||||
self::STATUS_DELETED | | |||||
self::STATUS_LDAP_READY | | |||||
self::STATUS_IMAP_READY; | |||||
// A template for the email attribute on a resource creation | // A template for the email attribute on a resource creation | ||||
public const EMAIL_TEMPLATE = 'resource-{id}@{domainName}'; | public const EMAIL_TEMPLATE = 'resource-{id}@{domainName}'; | ||||
/** @var array<string, string> The attributes that should be cast */ | /** @var array<string, string> The attributes that should be cast */ | ||||
protected $casts = [ | protected $casts = [ | ||||
'created_at' => 'datetime:Y-m-d H:i:s', | 'created_at' => 'datetime:Y-m-d H:i:s', | ||||
'deleted_at' => 'datetime:Y-m-d H:i:s', | 'deleted_at' => 'datetime:Y-m-d H:i:s', | ||||
'updated_at' => 'datetime:Y-m-d H:i:s', | 'updated_at' => 'datetime:Y-m-d H:i:s', | ||||
]; | ]; | ||||
/** @var array<int, string> The attributes that are mass assignable */ | /** @var array<int, string> The attributes that are mass assignable */ | ||||
protected $fillable = ['email', 'name', 'status']; | protected $fillable = ['email', 'name', 'status']; | ||||
} | } |