PHP Класс LMongo\Eloquent\Relations\BelongsTo

Наследование: extends Relation
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$foreignKey string The foreign key of the parent model.
$relation string The name of the relationship.

Открытые методы

Метод Описание
__construct ( Builder $query, Model $parent, string $foreignKey, string $relation ) : void Create a new has many relationship instance.
addConstraints ( ) : void Set the base constraints on the relation query.
addEagerConstraints ( array $models ) : void Set the constraints for an eager load of the relation.
associate ( Model $model ) : Model Associate the model instance to the given parent.
getForeignKey ( ) : string Get the foreign key of the relationship.
getResults ( ) : mixed Get the results of the relationship.
initRelation ( array $models, string $relation ) : void Initialize the relation on a set of models.
match ( array $models, Collection $results, string $relation ) : array Match the eagerly loaded results to their parents.
update ( array $attributes ) : mixed Update the parent model on the relationship.

Защищенные методы

Метод Описание
getEagerModelKeys ( array $models ) : array Gather the keys from an array of related models.

Описание методов

__construct() публичный Метод

Create a new has many relationship instance.
public __construct ( Builder $query, Model $parent, string $foreignKey, string $relation ) : void
$query LMongo\Eloquent\Builder
$parent LMongo\Eloquent\Model
$foreignKey string
$relation string
Результат void

addConstraints() публичный Метод

Set the base constraints on the relation query.
public addConstraints ( ) : void
Результат void

addEagerConstraints() публичный Метод

Set the constraints for an eager load of the relation.
public addEagerConstraints ( array $models ) : void
$models array
Результат void

associate() публичный Метод

Associate the model instance to the given parent.
public associate ( Model $model ) : Model
$model LMongo\Eloquent\Model
Результат LMongo\Eloquent\Model

getEagerModelKeys() защищенный Метод

Gather the keys from an array of related models.
protected getEagerModelKeys ( array $models ) : array
$models array
Результат array

getForeignKey() публичный Метод

Get the foreign key of the relationship.
public getForeignKey ( ) : string
Результат string

getResults() публичный Метод

Get the results of the relationship.
public getResults ( ) : mixed
Результат mixed

initRelation() публичный Метод

Initialize the relation on a set of models.
public initRelation ( array $models, string $relation ) : void
$models array
$relation string
Результат void

match() публичный Метод

Match the eagerly loaded results to their parents.
public match ( array $models, Collection $results, string $relation ) : array
$models array
$results LMongo\Eloquent\Collection
$relation string
Результат array

update() публичный Метод

Update the parent model on the relationship.
public update ( array $attributes ) : mixed
$attributes array
Результат mixed

Описание свойств

$foreignKey защищенное свойство

The foreign key of the parent model.
protected string $foreignKey
Результат string

$relation защищенное свойство

The name of the relationship.
protected string $relation
Результат string