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

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

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

Свойство Тип Описание
$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