Welcome Guest, Not a member yet? Register   Sign In
Codeigniter Model VS Query Builder
#4

(This post was last modified: 03-28-2020, 02:10 PM by dave friend.)

(03-27-2020, 02:37 PM)includebeer Wrote: That’s because you can call the query builder directly from the model class : https://codeigniter4.github.io/userguide...ry-builder
Yes, I think that was said. Maybe it wasn't stated clearly, but the implication is there. That "feature", plus the Model having functions that look like query builder functions (but are not) is, as the OP said, confusing.

Actually, it's more than confusing it is a rampant disregard for the OOP concept of encapsulation. Why is that an issue? Because it leads to questions like the OP. This is not the first time that questions have been asked about apparently buggy behavior that's not really a bug, but a misunderstanding about what really going on behind the scenes. A developer has to be keenly aware of which calls are Model and which are Query Builder lest they get unexpected results.
Reply


Messages In This Thread
RE: Codeigniter Model VS Query Builder - by dave friend - 03-28-2020, 02:07 PM



Theme © iAndrew 2016 - Forum software by © MyBB