public function countAffected($cursor = null)
    {
        if (!$cursor instanceof \PDOStatement) {
            $cursor = $this->getCursor();
        }

        if (!$cursor) {
            return 0;
        }

        return $cursor->rowCount();
    }