开发者

When does CakePHP call the is_connect method in a data source?

开发者 https://www.devze.com 2023-02-05 08:58 出处:网络
I notice many CakePHP data source authors create th开发者_运维百科e method to always return true. Is this so that you can ask the data source if it is connected ( like in a MySQL or Oracle db) or does

I notice many CakePHP data source authors create th开发者_运维百科e method to always return true. Is this so that you can ask the data source if it is connected ( like in a MySQL or Oracle db) or does the CakePHP data source itself call that function at some point?


there is a connected property in DBO_* but no methods like is_connected. you can also find a connect() method in the DBO files.

The connect will be called when the model is called as that will call the datasource. The reason most datasources will just return true is that they do not connect to anything. If might just be a file (csv datasource etc)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号