php-dao

Are DAO objects better than static DAO classes in PHP?

拜拜、爱过 提交于 2021-02-08 08:58:22
问题 I understand the reasons for not using statics in Java. However, I'm currently developing OO code in PHP. I use DAOs with the goal of keeping my queries in one place so I can easily find them. I also instantiate some DAOs so I can incorporate pagination in some (relevant) queries. In many cases, it's not necessary and so I tend to just create static methods (even though technically I don't think I can call that a DAO) in the form: $info = schemeDAO::someFunction($variable); I may need only