abstract class Relation (View source)

Properties

static protected bool $has_constraints

Indicates whether the relation is adding constraints.

static protected bool $has_pivot

Indicate whether the relationships use a pivot table.*.

protected string $foreign_key

The foreign key of the parent model.

protected string $local_key

The associated key on the parent model.

protected Model $parent

The parent model instance

$related

The related model instance

protected QueryBuilder $query

The Bow Query builder

Methods

__construct(Model $related, Model $parent)

Relation Contractor

void
addConstraints()

Set the base constraints on the relation query.

getParent()

Get the parent model.

getRelated()

Get associated model class.

mixed
__call(string $method, array $args = [])

_Call

create(array $attributes)

Create a new row of the related

mixed
getResults()

Get the results of the relationship.

Details

__construct(Model $related, Model $parent)

Relation Contractor

Parameters

Model $related
Model $parent

abstract void addConstraints()

Set the base constraints on the relation query.

Return Value

void

Model getParent()

Get the parent model.

Return Value

Model

Model getRelated()

Get associated model class.

Return Value

Model

mixed __call(string $method, array $args = [])

_Call

Parameters

string $method
array $args

Return Value

mixed

Model create(array $attributes)

Create a new row of the related

Parameters

array $attributes

Return Value

Model

abstract mixed getResults()

Get the results of the relationship.

Return Value

mixed