DMZ 1.7.1 (DataMapper OverZealous Edition) |
[eluser]TheJim[/eluser]
@Jack Scott, OverZealous Quote:It broke with a To offer an alternative to what Phil said, I believe the problem is that you're loading the class via CI's Loader, which calls _assign_libraries. If you follow the DMZ way of not calling load->model and just do a "new Whatever()" you shouldn't run into that problem. On a side note, I don't see why you'd really need to auto-load related models in your model's constructor, because accessing the related variable, e.g. "$user->group" will auto-load the related class anyway. That's just part of DMZ. And if you wanted the model in your controller, instantiating a DMZ model (as in the above paragraph) auto-loads as well. So maybe you have some reason for doing so, but I'd guess that you're going about it the hard way and that extension to the constructor isn't necessary. Letting the built-in lazy loading of related classes do its thing rather than loading all related classes whenever one is instantiated is bound to have some performance benefit too, possibly significant if you've got a bunch of classes all related to each other. |
Welcome Guest, Not a member yet? Register Sign In |