PointTransaction
extends Model
in package
implements
Entity
Uses
HasEntity, HasFactory, HasUserMorph, HasOwnerMorph, HasItemMorph
Class PointTransaction.
Tags
Table of Contents
Interfaces
- Entity
- Interface Entity.
Constants
- ENTITY_TYPE = 'activitypoint_transaction'
Properties
- $action : string
- $action_id : int
- $action_params : array<string|int, mixed>
- $created_at : string
- $id : int
- $is_hidden : bool
- $module_id : int
- $package_id : string
- $points : int
- $pointSetting : PointSetting|null
- $type : int
- $updated_at : string
- $casts : array<string|int, string>
- $fillable : array<string|int, string>
- $table : mixed
Methods
- entityId() : int
- entityType() : string
- factory() : PointTransactionFactory
- getAction() : string
- getActionType() : string
- getItemAttribute() : mixed
- getOwnerAttribute() : mixed
- getOwnerEntityAttribute() : mixed
- getUserAttribute() : mixed
- getUserEntityAttribute() : mixed
- isOwner() : bool
- check if $user is the owner of entity.
- isUser() : bool
- check if $user is the user (creator) of entity.
- item() : MorphTo|null
- itemId() : int
- itemType() : string
- moduleName() : string
- owner() : MorphTo
- ownerEntity() : BelongsTo
- ownerId() : int
- ownerType() : string
- setting() : BelongsTo
- user() : MorphTo
- userEntity() : BelongsTo
- userId() : int
- userType() : string
- isAdded() : Attribute
- isSubtracted() : Attribute
- newFactory() : PointTransactionFactory
Constants
ENTITY_TYPE
public
mixed
ENTITY_TYPE
= 'activitypoint_transaction'
Properties
$action
public
string
$action
$action_id
public
int
$action_id
$action_params
public
array<string|int, mixed>
$action_params
$created_at
public
string
$created_at
$id
public
int
$id
$is_hidden
public
bool
$is_hidden
$module_id
public
int
$module_id
$package_id
public
string
$package_id
$points
public
int
$points
$pointSetting
public
PointSetting|null
$pointSetting
$type
public
int
$type
$updated_at
public
string
$updated_at
$casts
protected
array<string|int, string>
$casts
= ['is_hidden' => 'boolean', 'action_params' => 'array']
$fillable
protected
array<string|int, string>
$fillable
= ['user_id', 'user_type', 'owner_id', 'owner_type', 'module_id', 'package_id', 'type', 'action', 'points', 'is_hidden', 'is_admincp', 'action_params', 'point_setting_id', 'created_at', 'updated_at', 'item_id', 'item_type', 'action_id']
$table
protected
mixed
$table
= 'apt_transactions'
Methods
entityId()
public
entityId() : int
Return values
intentityType()
public
entityType() : string
Return values
stringfactory()
public
static factory(mixed $parameters) : PointTransactionFactory
Parameters
- $parameters : mixed
Return values
PointTransactionFactorygetAction()
public
getAction(User|null $context) : string
Parameters
- $context : User|null
Return values
stringgetActionType()
public
getActionType(User|null $context) : string
Parameters
- $context : User|null
Return values
stringgetItemAttribute()
public
getItemAttribute() : mixed
getOwnerAttribute()
public
getOwnerAttribute() : mixed
getOwnerEntityAttribute()
public
getOwnerEntityAttribute() : mixed
getUserAttribute()
public
getUserAttribute() : mixed
getUserEntityAttribute()
public
getUserEntityAttribute() : mixed
isOwner()
check if $user is the owner of entity.
public
isOwner(User $user) : bool
Parameters
- $user : User
Return values
boolisUser()
check if $user is the user (creator) of entity.
public
isUser(User $user) : bool
Parameters
- $user : User
Return values
boolitem()
public
item() : MorphTo|null
Return values
MorphTo|nullitemId()
public
itemId() : int
Return values
intitemType()
public
itemType() : string
Return values
stringmoduleName()
public
moduleName() : string
Return values
stringowner()
public
owner() : MorphTo
Return values
MorphToownerEntity()
public
ownerEntity() : BelongsTo
Return values
BelongsToownerId()
public
ownerId() : int
Return values
intownerType()
public
ownerType() : string
Return values
stringsetting()
public
setting() : BelongsTo
Return values
BelongsTouser()
public
user() : MorphTo
Return values
MorphTouserEntity()
public
userEntity() : BelongsTo
Return values
BelongsTouserId()
public
userId() : int
Return values
intuserType()
public
userType() : string
Return values
stringisAdded()
protected
isAdded() : Attribute
Return values
AttributeisSubtracted()
protected
isSubtracted() : Attribute
Return values
AttributenewFactory()
protected
static newFactory() : PointTransactionFactory