protected function _processUpdate(Query $query, array $options = []) {
        $data = $query->getData();
        $options = $options + [
            'before' => true,
            'after' => true
        ];

        // Fetch ID
        $this->id = $id = $this->findID($query);

        if ($options['before']) {
            foreach (['db.preSave', 'db.preUpdate'] as $event) {
                $event = $this->emit($event, [$query, $id, &$data]);

                if (!$event->getState()) {
                    return 0;
                }
            }
        }

        // Reset the modified data
        $query->data($data);

        // Update the connection context and execute the query
        $count = $this->getDriver()
            ->setContext('write')
            ->executeQuery($query)
            ->save();

        // Exit early if save failed
        if ($count === false) {
            return false;
        }

        if ($options['after']) {
            $this->emit('db.postSave db.postUpdate', [$id, $count]);
        }

        return $count;
    }