SavedAgg
extends Model
in package
implements
Entity, HasAmounts
Uses
HasEntity, HasFactory, HasUserMorph, HasUserAsOwnerMorph, HasAmountsTrait
Class SavedAgg.
Table of Contents
Interfaces
- Entity
- Interface Entity.
- HasAmounts
- Trait HasAmounts
Constants
- ENTITY_TYPE = 'saved_aggregation'
Properties
- $id : int
- $item_type : string
- $timestamps : mixed
- $total_saved : int
- $user_id : int
- $user_type : string
- $fillable : array<string|int, string>
- $table : mixed
Methods
- decrementAmount() : int
- decrementTotalItem() : void
- entityId() : int
- entityType() : string
- factory() : SavedAggFactory
- getUserAttribute() : mixed
- getUserEntityAttribute() : mixed
- incrementAmount() : int
- incrementTotalItem() : void
- incrementTotalView() : void
- isUser() : bool
- check if $user is the user (creator) of entity.
- moduleName() : string
- owner() : MorphTo
- ownerEntity() : BelongsTo
- ownerId() : int
- ownerType() : string
- user() : MorphTo
- userEntity() : BelongsTo
- userId() : int
- userType() : string
- handleNegativeNumber() : void
- newFactory() : SavedAggFactory
Constants
ENTITY_TYPE
public
mixed
ENTITY_TYPE
= 'saved_aggregation'
Properties
$id
public
int
$id
$item_type
public
string
$item_type
$timestamps
public
mixed
$timestamps
= false
$total_saved
public
int
$total_saved
$user_id
public
int
$user_id
$user_type
public
string
$user_type
$fillable
protected
array<string|int, string>
$fillable
= ['user_id', 'user_type', 'item_type', 'total_saved']
$table
protected
mixed
$table
= 'saved_aggregations'
Methods
decrementAmount()
public
decrementAmount(string $column[, int $amount = 1 ]) : int
Parameters
- $column : string
- $amount : int = 1
Return values
intdecrementTotalItem()
public
decrementTotalItem() : void
entityId()
public
entityId() : int
Return values
intentityType()
public
entityType() : string
Return values
stringfactory()
public
static factory(mixed $parameters) : SavedAggFactory
Parameters
- $parameters : mixed
Return values
SavedAggFactorygetUserAttribute()
public
getUserAttribute() : mixed
getUserEntityAttribute()
public
getUserEntityAttribute() : mixed
incrementAmount()
public
incrementAmount(string $column[, int $amount = 1 ]) : int
Parameters
- $column : string
- $amount : int = 1
Return values
intincrementTotalItem()
public
incrementTotalItem() : void
incrementTotalView()
public
incrementTotalView() : void
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
stringowner()
public
owner() : MorphTo
Return values
MorphToownerEntity()
public
ownerEntity() : BelongsTo
Return values
BelongsToownerId()
public
ownerId() : int
Return values
intownerType()
public
ownerType() : 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
stringhandleNegativeNumber()
protected
handleNegativeNumber(string $column) : void
Parameters
- $column : string
newFactory()
protected
static newFactory() : SavedAggFactory