Object in session in MY_Controller clears the session completely. |
[eluser]WanWizard[/eluser]
How do you load your classes? If you use $this->load..., CI will attach all loaded libraries to it. Which are assigned by reference, so memory wise that's not a problem. But don't try to print_r() or var_dump() them.
[eluser]pegas[/eluser]
I load the container classes like so Code: class Schedule_model extends CI_Model { If what you say about the CI library being attached, then why am I not getting any return back from the loadOrCreateModules function. There are 30 records in that database, and I've surelly dealt with bigger objects. I tried both the classic queries and the method you see above and the object still get appended with those values. I tried to see if this info is attached to every query but it isn't the case, so I'm assuming it's something wrong with my objects or the logic o my code somewhere.. P.S: I load a week_days array of WeekDay objects, and these values mentioned above are not present. I'm kinda stuck on this for 2 days now so any suggestions are welcomed. Thanks again
[eluser]WanWizard[/eluser]
How do you load your Schedule class? Because CI's objects are attached to that according to your dump(). In the class itself (is that all code?) I don't see any reference to CI's classes, and it also doesn't extend anything. Why your code doesn't work? I don't know. The presence of CI's objects don't slow things down. No error messages? Nothing in the logs?
[eluser]pegas[/eluser]
THANK YOU. I realized what the problem was. I load my entities just like I load WeekDay or Module. But the problem was that when I did "new Schedule" it took the controller class "schedule" and not the entity class, which was in fact never loaded. Now I renamed my controller and added a capital "C" so my declarations would be distinct, did a little search an replace in my JavaScripts, loaded the entity class in the "Schedule_model" and I am good to go. Thanks for pointing out my error ![]() ![]()
[eluser]InsiteFX[/eluser]
This problem has been answered here before, but cannnot find the thread. The problem is that the serialize and unserialize methods in the seesion class do not handle objects there is a fix for it someplace on the forums. InsiteFX
[eluser]pegas[/eluser]
I don't really get what u're saying. I had a naming problem, and I was loading the Controller object instead of the container object I needed, so that's why it put in all that extra data, and was so "heavy" that it simply didn't return anything. Of course, if you're talking about @dakipro's problem, I surelly have no clue ![]()
[eluser]dakipro[/eluser]
I guess my problem on this thread is same (similar) to this reported bug https://bitbucket.org/ellislab/codeignit...on-library Anyway, I didn't solve it that way, so far I'm being careful what I'm putting into the session, and I also switched to the native PHP sessions. I do lose some advantages but at least all common chars work as expected (I hope ![]() |
Welcome Guest, Not a member yet? Register Sign In |