HasOwner
HasOwner
Table of Contents
- $model : Model|null
- $owner : Model
- $owner_id : int
- $owner_type : class-string
- belongsToModel() : bool
- hasOwner() : bool
- morphTo() : MorphTo
- Define a polymorphic, inverse one-to-one or many relationship.
- owner() : MorphTo
- setOwner() : static
Properties
$model
public
Model|null
$model
$owner
public
Model
$owner
$owner_id
public
int
$owner_id
$owner_type
public
class-string
$owner_type
Methods
belongsToModel()
public
belongsToModel(Model $model) : bool
Parameters
- $model : Model
Tags
Return values
bool —hasOwner()
public
hasOwner() : bool
Tags
Return values
bool —morphTo()
Define a polymorphic, inverse one-to-one or many relationship.
public
abstract morphTo([string|null $name = null ][, string|null $type = null ][, string|null $id = null ][, string|null $ownerKey = null ]) : MorphTo
Parameters
- $name : string|null = null
- $type : string|null = null
- $id : string|null = null
- $ownerKey : string|null = null
Tags
Return values
MorphTo —owner()
public
owner() : MorphTo
Tags
Return values
MorphTo —setOwner()
public
setOwner(Model $owner) : static
Parameters
- $owner : Model