Can an object have an instance of another class inside it as a data member? For instance, can my "Files" class have an instance of a "User" class inside it? If so, how would I address it?
$myFileObject = new File;
$myFileObject->initializeFile($fileID);
Then in the intializeFile method, I have something like:
$this->userObject = new User;
Is this legal? If so, I guess I would access it by:
$myFileObject->userObject->initializeUser($userID);
Right? Before I write this entire thing, I'd just like to get a yay or nay :-)
Thanks in advance,
Brian