Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F1841688
Resource.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
Resource.php
View Options
<?php
namespace
App
;
use
App\Traits\BelongsToTenantTrait
;
use
App\Traits\EntitleableTrait
;
use
App\Traits\EmailPropertyTrait
;
use
App\Traits\ResourceConfigTrait
;
use
App\Traits\SettingsTrait
;
use
App\Traits\StatusPropertyTrait
;
use
App\Traits\UuidIntKeyTrait
;
use
Illuminate\Database\Eloquent\Model
;
use
Illuminate\Database\Eloquent\SoftDeletes
;
/**
* The eloquent definition of a Resource.
*
* @property int $id The resource identifier
* @property string $email An email address
* @property string $name The resource name
* @property int $status The resource status
* @property int $tenant_id Tenant identifier
*/
class
Resource
extends
Model
{
use
BelongsToTenantTrait
;
use
EntitleableTrait
;
use
ResourceConfigTrait
;
use
SettingsTrait
;
use
SoftDeletes
;
use
StatusPropertyTrait
;
use
UuidIntKeyTrait
;
use
EmailPropertyTrait
;
// must be first after UuidIntKeyTrait
// we've simply never heard of this resource
public
const
STATUS_NEW
=
1
<<
0
;
// resource has been activated
public
const
STATUS_ACTIVE
=
1
<<
1
;
// resource has been suspended.
// public const STATUS_SUSPENDED = 1 << 2;
// resource has been deleted
public
const
STATUS_DELETED
=
1
<<
3
;
// resource has been created in LDAP
public
const
STATUS_LDAP_READY
=
1
<<
4
;
// resource has been created in IMAP
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
public
const
EMAIL_TEMPLATE
=
'resource-{id}@{domainName}'
;
/** @var array<string, string> The attributes that should be cast */
protected
$casts
=
[
'created_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'
,
];
/** @var array<int, string> The attributes that are mass assignable */
protected
$fillable
=
[
'email'
,
'name'
,
'status'
];
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, Aug 25, 3:39 PM (1 d, 19 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
217941
Default Alt Text
Resource.php (2 KB)
Attached To
Mode
R2 kolab
Attached
Detach File
Event Timeline
Log In to Comment