PHP Class LMongo\Eloquent\Relations\MorphOneOrMany

Inheritance: extends HasOneOrMany
Afficher le fichier Open project: navruzm/lmongo

Protected Properties

Свойство Type Description
$morphClass string The class name of the parent model.
$morphType string The foreign key type for the relationship.

Méthodes publiques

Méthode Description
__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.

Method Details

__construct() public méthode

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
Résultat void

addConstraints() public méthode

Set the base constraints on the relation query.
public addConstraints ( ) : void
Résultat void

addEagerConstraints() public méthode

Set the constraints for an eager load of the relation.
public addEagerConstraints ( array $models ) : void
$models array
Résultat void

create() public méthode

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

getAndResetWheres() public méthode

The remaining constraints on the query will be reset and returned.
public getAndResetWheres ( ) : array
Résultat array

getMorphClass() public méthode

Get the class name of the parent model.
public getMorphClass ( ) : string
Résultat string

getMorphType() public méthode

Get the foreign key "type" name.
public getMorphType ( ) : string
Résultat string

save() public méthode

Attach a model instance to the parent model.
public save ( Model $model ) : Model
$model LMongo\Eloquent\Model
Résultat LMongo\Eloquent\Model

Property Details

$morphClass protected_oe property

The class name of the parent model.
protected string $morphClass
Résultat string

$morphType protected_oe property

The foreign key type for the relationship.
protected string $morphType
Résultat string