Mongolid\Model\Relations::embed PHP 메소드

embed() 공개 메소드

Embed a new document to an attribute. It will also generate an _id for the document if it's not present.
public embed ( string $field, mixed &$obj ) : void
$field string Field to where the $obj will be embedded.
$obj mixed Document or model instance.
리턴 void
    public function embed(string $field, &$obj)
    {
        $embedder = Ioc::make(DocumentEmbedder::class);
        $embedder->embed($this, $field, $obj);
    }