R
In some common cases, this issue is usually dealt with simply enough - or using the Singleton (Single) pattern to request a base connection, or not re-establishing one DAO facility to access the data (which remains hidden under the capt) when approaching the model. Thus, the connection does not open until it is necessary (and, if not, not open at all) and the compound is available in the amount of additives to the HTTP query processed, which in the vast majority of cases is sufficient.Examples of organization of compounds with OBD: https://laravel.com/docs/5.8/database ♪ https://www.yiiframework.com/doc/guide/2.0/ru/start-databases ♪Symfony won't write, there's a variety of different things - and Doctrine, and Eloquent, and the hell in the step, and the frog in the soup.Thus, in practice, it is possible to conclude that the best thing to do is create a connection with the OBD "stay under the hood" when dealing with high-level operations, and "not lighting" in places such as the controller. Although, if you (as I am) prefer to, in some cases, perform a manual sunset and a post-gathering napkin to achieve optimal productivity-- look towards Singleton's and a package. https://www.google.com/search?q=php%20Capsule ♪