LMongo\Eloquent\Model::hasMany PHP Метод

hasMany() публичный Метод

Define a one-to-many relationship.
public hasMany ( string $related, string $foreignKey = null ) : HasMany
$related string
$foreignKey string
Результат LMongo\Eloquent\Relations\HasMany
    public function hasMany($related, $foreignKey = null)
    {
        $foreignKey = $foreignKey ?: $this->getForeignKey();
        $instance = new $related();
        return new HasMany($instance->newQuery(), $this, $foreignKey);
    }
Model