ReportOwner
extends Model
in package
implements
Entity, HasAmounts
Uses
HasEntity, HasFactory, HasOwnerMorph, HasItemMorph, HasAmountsTrait
Class ReportOwner.
Table of Contents
Interfaces
- Entity
- Interface Entity.
- HasAmounts
- Trait HasAmounts
Constants
- ENTITY_TYPE = 'report_owner'
Properties
- $created_at : string
- $id : int
- $total_report : int
- $updated_at : string
- $userReports : ReportOwnerUser
- $fillable : array<string|int, string>
- $table : mixed
Methods
- decrementAmount() : int
- decrementTotalItem() : void
- entityId() : int
- entityType() : string
- factory() : ReportOwnerFactory
- getItemAttribute() : mixed
- getOwnerAttribute() : mixed
- getOwnerEntityAttribute() : mixed
- incrementAmount() : int
- incrementTotalItem() : void
- incrementTotalView() : void
- isOwner() : bool
- check if $user is the owner of entity.
- item() : MorphTo|null
- itemId() : int
- itemType() : string
- moduleName() : string
- owner() : MorphTo
- ownerEntity() : BelongsTo
- ownerId() : int
- ownerType() : string
- userReports() : HasMany
- handleNegativeNumber() : void
- newFactory() : ReportOwnerFactory
Constants
ENTITY_TYPE
public
mixed
ENTITY_TYPE
= 'report_owner'
Properties
$created_at
public
string
$created_at
$id
public
int
$id
$total_report
public
int
$total_report
$updated_at
public
string
$updated_at
$userReports
public
ReportOwnerUser
$userReports
$fillable
protected
array<string|int, string>
$fillable
= ['owner_id', 'owner_type', 'item_id', 'item_type', 'total_report']
$table
protected
mixed
$table
= 'report_owners'
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) : ReportOwnerFactory
Parameters
- $parameters : mixed
Return values
ReportOwnerFactorygetItemAttribute()
public
getItemAttribute() : mixed
getOwnerAttribute()
public
getOwnerAttribute() : mixed
getOwnerEntityAttribute()
public
getOwnerEntityAttribute() : 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
isOwner()
check if $user is the owner of entity.
public
isOwner(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
stringuserReports()
public
userReports() : HasMany
Return values
HasManyhandleNegativeNumber()
protected
handleNegativeNumber(string $column) : void
Parameters
- $column : string
newFactory()
protected
static newFactory() : ReportOwnerFactory