Passing a lot of info from one class to another?
Moderator: General Moderators
-
psychotomus
- Forum Contributor
- Posts: 487
- Joined: Fri Jul 11, 2003 1:59 am
Passing a lot of info from one class to another?
How can I pass my user class info to another class? I hear of this thing called inherit but never used it. I got a lot of user vars..
- MindOverBody
- Forum Commoner
- Posts: 96
- Joined: Fri Aug 06, 2010 9:01 pm
- Location: Osijek, Croatia
Re: Passing a lot of info from one class to another?
Code: Select all
class Person {
public $name;
public $surname;
}
class Employee extends Person {
public $skill;
public $salary;
}
But, if you make instance of Person, your object will hold only name and surname properties. It's simple as that.
-
psychotomus
- Forum Contributor
- Posts: 487
- Joined: Fri Jul 11, 2003 1:59 am
Re: Passing a lot of info from one class to another?
pretty simple. Thanks!!