src/FrontendIntegration/MetaModelHybrid.php
protected function getConnection()
    {
        if (null === $this->connection) {
            // @codingStandardsIgnoreStart
            @trigger_error(
                'Connection is missing in class ' . static::class .
                '. The automatic fallback will be dropped in MetaModels 3.0. Please use dependency injection',
                E_USER_DEPRECATED
            );
            // @codingStandardsIgnoreEnd
            return $this->connection = System::getContainer()->get('database_connection');
        }

        return $this->connection;
    }
protected function getConnection()
    {
        if (null === $this->connection) {
            // @codingStandardsIgnoreStart
            @trigger_error(
                'Connection is missing in class ' . static::class .
                '. The automatic fallback will be dropped in MetaModels 3.0. Please use dependency injection',
                E_USER_DEPRECATED
            );
            // @codingStandardsIgnoreEnd
            return $this->connection = System::getContainer()->get('database_connection');
        }

        return $this->connection;
    }
Retrieve the connection.

@return Connection