public function update($dataset, $condFields = null, $updateNulls = false)
    {
        // Event
        $this->triggerEvent(
            'onBefore' . ucfirst(__FUNCTION__),
            [
                'dataset' => &$dataset,
                'condFields' => &$condFields,
                'updateNulls' => &$updateNulls,
            ]
        );

        if (!($dataset instanceof \Traversable) && !is_array($dataset)) {
            throw new \InvalidArgumentException('DataSet object should be instance of a Traversable');
        }

        // Handling conditions
        $condFields = $condFields ?: $this->getKeyName(true);

        $result = $this->doUpdate($dataset, (array) $condFields, $updateNulls);

        // Event
        $this->triggerEvent(
            'onAfter' . ucfirst(__FUNCTION__),
            [
                'result' => &$result,
            ]
        );

        return $result;
    }