PackagePurchase
        
        extends Model
    
    
            
            in package
            
        
    
            
            implements
                            Entity,                             IsBillable                    
    
            
            Uses
                            HasEntity,                             HasFactory,                             HasUserMorph,                             BillableTrait                    
    
Class PackagePurchase.
Tags
Table of Contents
Interfaces
- Entity
 - Interface Entity.
 - IsBillable
 
Constants
- ENTITY_TYPE = 'activitypoint_package_purchase'
 - STATUS_FAILED = 3
 - STATUS_INIT = 1
 - STATUS_SUCCESS = 2
 
Properties
- $created_at : string
 - $currency : Currency
 - $gateway_id : int
 - $id : int
 - $package : PointPackage
 - $points : int
 - $price : float
 - $status : int
 - $updated_at : string
 - $fillable : array<string|int, string>
 - $table : mixed
 
Methods
- currency() : BelongsTo
 - entityId() : int
 - entityType() : string
 - factory() : PackagePurchaseFactory
 - getCurrency() : string
 - getTotal() : float
 - getUserAttribute() : mixed
 - getUserEntityAttribute() : mixed
 - isUser() : bool
 - check if $user is the user (creator) of entity.
 - moduleName() : string
 - package() : BelongsTo
 - product() : BelongsTo
 - toTitle() : string
 - user() : MorphTo
 - userEntity() : BelongsTo
 - userId() : int
 - userType() : string
 - newFactory() : PackagePurchaseFactory
 
Constants
ENTITY_TYPE
    public
        mixed
    ENTITY_TYPE
    = 'activitypoint_package_purchase'
    
    
    
STATUS_FAILED
    public
        mixed
    STATUS_FAILED
    = 3
    
    
    
STATUS_INIT
    public
        mixed
    STATUS_INIT
    = 1
    
    
    
STATUS_SUCCESS
    public
        mixed
    STATUS_SUCCESS
    = 2
    
    
    
Properties
$created_at
    public
        string
    $created_at
    
    
    
    
$currency
    public
        Currency
    $currency
    
    
    
    
$gateway_id
    public
        int
    $gateway_id
    
    
    
    
$id
    public
        int
    $id
    
    
    
    
$package
    public
        PointPackage
    $package
    
    
    
    
$points
    public
        int
    $points
    
    
    
    
$price
    public
        float
    $price
    
    
    
    
$status
    public
        int
    $status
    
    
    
    
$updated_at
    public
        string
    $updated_at
    
    
    
    
$fillable
    protected
        array<string|int, string>
    $fillable
     = ['user_id', 'user_type', 'package_id', 'status', 'price', 'currency_id', 'gateway_id', 'points', 'created_at', 'updated_at']
    
    
    
$table
    protected
        mixed
    $table
     = 'apt_package_purchases'
    
    
    
Methods
currency()
    public
                    currency() : BelongsTo
    Return values
BelongsToentityId()
    public
                    entityId() : int
    Return values
intentityType()
    public
                    entityType() : string
    Return values
stringfactory()
    public
            static        factory(mixed $parameters) : PackagePurchaseFactory
    Parameters
- $parameters : mixed
 
Return values
PackagePurchaseFactorygetCurrency()
    public
                    getCurrency() : string
    Return values
stringgetTotal()
    public
                    getTotal() : float
    Return values
floatgetUserAttribute()
    public
                    getUserAttribute() : mixed
    getUserEntityAttribute()
    public
                    getUserEntityAttribute() : mixed
    isUser()
check if $user is the user (creator) of entity.
    public
                    isUser(User $user) : bool
    Parameters
- $user : User
 
Return values
boolmoduleName()
    public
                    moduleName() : string
    Return values
stringpackage()
    public
                    package() : BelongsTo
    Return values
BelongsToproduct()
    public
                    product() : BelongsTo
    Return values
BelongsTotoTitle()
    public
                    toTitle() : string
    Return values
stringuser()
    public
                    user() : MorphTo
    Return values
MorphTouserEntity()
    public
                    userEntity() : BelongsTo
    Return values
BelongsTouserId()
    public
                    userId() : int
    Return values
intuserType()
    public
                    userType() : string
    Return values
stringnewFactory()
    protected
            static        newFactory() : PackagePurchaseFactory