PHP 클래스 LMongo\Eloquent\Relations\MorphOneOrMany

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

보호된 프로퍼티들

프로퍼티 타입 설명
$morphClass string The class name of the parent model.
$morphType string The foreign key type for the relationship.

공개 메소드들

메소드 설명
__construct ( Builder $query, Model $parent, string $type, string $id ) : 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.
create ( array $attributes ) : Model Create a new instance of the related model.
getAndResetWheres ( ) : array Remove the original where clause set by the relationship.
getMorphClass ( ) : string Get the class name of the parent model.
getMorphType ( ) : string Get the foreign key "type" name.
save ( Model $model ) : Model Attach a model instance to the parent model.

메소드 상세

__construct() 공개 메소드

Create a new has many relationship instance.
public __construct ( Builder $query, Model $parent, string $type, string $id ) : void
$query LMongo\Eloquent\Builder
$parent LMongo\Eloquent\Model
$type string
$id 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

create() 공개 메소드

Create a new instance of the related model.
public create ( array $attributes ) : Model
$attributes array
리턴 LMongo\Eloquent\Model

getAndResetWheres() 공개 메소드

The remaining constraints on the query will be reset and returned.
public getAndResetWheres ( ) : array
리턴 array

getMorphClass() 공개 메소드

Get the class name of the parent model.
public getMorphClass ( ) : string
리턴 string

getMorphType() 공개 메소드

Get the foreign key "type" name.
public getMorphType ( ) : string
리턴 string

save() 공개 메소드

Attach a model instance to the parent model.
public save ( Model $model ) : Model
$model LMongo\Eloquent\Model
리턴 LMongo\Eloquent\Model

프로퍼티 상세

$morphClass 보호되어 있는 프로퍼티

The class name of the parent model.
protected string $morphClass
리턴 string

$morphType 보호되어 있는 프로퍼티

The foreign key type for the relationship.
protected string $morphType
리턴 string