private static function getEntityManager(Event $event)
    {
        if (null === self::$em) {
            if (null !== self::getApplication($event)) {
                self::$em = self::getApplication($event)->getEntityManager();
            }
        }

        return self::$em;
    }
private static function getEntityManager(Event $event)
    {
        if (null === self::$em) {
            if (null !== self::getApplication($event)) {
                self::$em = self::getApplication($event)->getEntityManager();
            }
        }

        return self::$em;
    }
private static function getEntityManager ( Event $ event ) { if ( null === self :: $ em ) { if ( null !== self :: getApplication ( $ event ) ) { self :: $ em = self :: getApplication ( $ event ) -> getEntityManager ( ) ; } } return self :: $ em ; }
Returns the current entity manager.

@param Event $event

@return EntityManager
Returns the current entity manager .