Unfortunately I am limited to PHP4 on my server, and since I've started using OOP not too long ago, I run into some frameworking issues.
Example:
I have a class User, which generates a userID for me. I instantiate User from my index.php, in var $user.
I also have a class Core, which handles all my actions (ie. building a menu, building content, etc), but does so by instantiating other classes. So Core::BuildMenu() may actually instantiate a class Menu, which then gets the menus I want the user to see.
However, class Menu needs to know my userID, so it can load the appropriate menus. From my Menu class I cannot reach the var $user, so I cannot obtain $user->userID. 🙁
I could of course pass the userID var to my Core class, and from there to my Menu class, but this seems like bad practice to me.
I could also store the userID in the Session, but I can't imagine that to be safe.
Does anyone know how I should or could handle this?