Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F120836484
Entitlement.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
2 KB
Referenced Files
None
Subscribers
None
Entitlement.php
View Options
<?php
namespace
App
;
use
Carbon\Carbon
;
use
Illuminate\Database\Eloquent\Model
;
use
Illuminate\Database\Eloquent\SoftDeletes
;
/**
* The eloquent definition of an Entitlement.
*
* Owned by a {@link \App\User}, billed to a {@link \App\Wallet}.
*
* @property \App\User $owner The owner of this entitlement (subject).
* @property \App\Sku $sku The SKU to which this entitlement applies.
* @property \App\Wallet $wallet The wallet to which this entitlement is charged.
* @property \App\Domain|\App\User $entitleable The entitled object (receiver of the entitlement).
*/
class
Entitlement
extends
Model
{
use
SoftDeletes
;
/**
* This table does not use auto-increment.
*
* @var boolean
*/
public
$incrementing
=
false
;
/**
* The key type is actually a string.
*
* @var string
*/
protected
$keyType
=
'string'
;
/**
* The fillable columns for this Entitlement
*
* @var array
*/
protected
$fillable
=
[
'sku_id'
,
'wallet_id'
,
'entitleable_id'
,
'entitleable_type'
,
'cost'
,
'description'
];
protected
$casts
=
[
'cost'
=>
'integer'
,
];
/**
* Principally entitleable objects such as 'Domain' or 'User'.
*
* @return mixed
*/
public
function
entitleable
()
{
return
$this
->
morphTo
();
}
/**
* The SKU concerned.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public
function
sku
()
{
return
$this
->
belongsTo
(
'App
\S
ku'
);
}
/**
* The wallet this entitlement is being billed to
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public
function
wallet
()
{
return
$this
->
belongsTo
(
'App
\W
allet'
);
}
/**
* Cost mutator. Make sure cost is integer.
*/
public
function
setCostAttribute
(
$cost
):
void
{
$this
->
attributes
[
'cost'
]
=
round
(
$cost
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Fri, Apr 24, 1:31 PM (6 h, 31 m ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
99/d3/42e9491da56d74c603d09cec7b87
Default Alt Text
Entitlement.php (2 KB)
Attached To
Mode
rK kolab
Attached
Detach File
Event Timeline