LMongo\Eloquent\Model::morphMany PHP Method

morphMany() public method

Define a polymorphic one-to-many relationship.
public morphMany ( string $related, string $name, string $type = null, string $id = null ) : LMongo\Eloquent\Relation\MorphMany
$related string
$name string
$type string
$id string
return LMongo\Eloquent\Relation\MorphMany
    public function morphMany($related, $name, $type = null, $id = null)
    {
        $instance = new $related();
        list($type, $id) = $this->getMorphs($name, $type, $id);
        return new MorphMany($instance->newQuery(), $this, $type, $id);
    }
Model