PHP 클래스 LMongo\Eloquent\Relations\BelongsTo

상속: extends Relation
파일 보기 프로젝트 열기: navruzm/lmongo

보호된 프로퍼티들

프로퍼티 타입 설명
$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