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;
    }
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;
    }
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 ; }
Returns a connection by its Id or the whole collection if not Id passed.

@author Benjamin Carl <opensource@clickalicious.de>

@return EntityManager[]
Returns a connection by its Id or the whole collection if not Id passed .