DB\Mongo\Mapper::update PHP Метод

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

Update current record
public update ( ) : array
Результат array
    function update()
    {
        $pkey = ['_id' => $this->document['_id']];
        if (isset($this->trigger['beforeupdate']) && \Base::instance()->call($this->trigger['beforeupdate'], [$this, $pkey]) === FALSE) {
            return $this->document;
        }
        $this->collection->update($pkey, $this->document, ['upsert' => TRUE]);
        if (isset($this->trigger['afterupdate'])) {
            \Base::instance()->call($this->trigger['afterupdate'], [$this, $pkey]);
        }
        return $this->document;
    }