PHP 클래스 LMongo\Eloquent\Relations\BelongsToMany

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

보호된 프로퍼티들

프로퍼티 타입 설명
$foreignKey string The foreign key of the parent model.
$otherKey string The associated key of the relation.

공개 메소드들

메소드 설명
__construct ( Builder $query, Model $parent, string $foreignKey, string $otherKey ) : void Create a new has many relationship instance.
attach ( mixed $related ) : void Attach a model to the parent.
create ( array $attributes ) : Model Create a new instance of the related model.
createMany ( array $records ) : Model Create an array of new instances of the related models.
detach ( integer $related ) : void Detach models from the relationship.
getOtherKey ( ) : string Get the other key for 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.
save ( Model $model ) : Model Save a new model and attach it to the parent model.
saveMany ( array $models ) : array Save an array of new models and attach them to the parent model.
sync ( array $ids ) : void Sync the intermediate tables with a list of IDs.

보호된 메소드들

메소드 설명
buildDictionary ( Collection $results ) : array Build model dictionary keyed by the relation's foreign key.

메소드 상세

__construct() 공개 메소드

Create a new has many relationship instance.
public __construct ( Builder $query, Model $parent, string $foreignKey, string $otherKey ) : void
$query LMongo\Eloquent\Builder
$parent LMongo\Eloquent\Model
$foreignKey string
$otherKey string
리턴 void

attach() 공개 메소드

Attach a model to the parent.
public attach ( mixed $related ) : void
$related mixed
리턴 void

buildDictionary() 보호된 메소드

Build model dictionary keyed by the relation's foreign key.
protected buildDictionary ( Collection $results ) : array
$results LMongo\Eloquent\Collection
리턴 array

create() 공개 메소드

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

createMany() 공개 메소드

Create an array of new instances of the related models.
public createMany ( array $records ) : Model
$records array
리턴 LMongo\Eloquent\Model

detach() 공개 메소드

Detach models from the relationship.
public detach ( integer $related ) : void
$related integer
리턴 void

getOtherKey() 공개 메소드

Get the other key for the relationship.
public getOtherKey ( ) : 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

save() 공개 메소드

Save a new model and attach it to the parent model.
public save ( Model $model ) : Model
$model LMongo\Eloquent\Model
리턴 LMongo\Eloquent\Model

saveMany() 공개 메소드

Save an array of new models and attach them to the parent model.
public saveMany ( array $models ) : array
$models array
리턴 array

sync() 공개 메소드

Sync the intermediate tables with a list of IDs.
public sync ( array $ids ) : void
$ids array
리턴 void

프로퍼티 상세

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

The foreign key of the parent model.
protected string $foreignKey
리턴 string

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

The associated key of the relation.
protected string $otherKey
리턴 string