Mongolid\Model\Relations::attach PHP Метод

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

Attach document _id reference to an attribute. It will also generate an _id for the document if it's not present.
public attach ( string $field, mixed &$obj ) : void
$field string Name of the field where the reference will be stored.
$obj mixed Document, model instance or _id to be referenced.
Результат void
    public function attach(string $field, &$obj)
    {
        $embedder = Ioc::make(DocumentEmbedder::class);
        $embedder->attach($this, $field, $obj);
    }