public function getConnection($id = null)
    {
        if (null === $id) {
            $result = self::$connection;

        } else {
            if (false === isset(self::$connection[$id])) {
                throw new \Doozr_Exception(
                    sprintf(
                        'EntityManager connection with Id "%s" does not exist!',
                        $id
                    )
                );
            }

            $result = self::$connection[$id];
        }

        return $result;
    }