I've written a user account object, and I already have a construct that create the user, but with that object I must insert the data that I want the user objec to hold (for example, user name, email address, password etc).
I also want a construct that doesn't need any parameters (which, creates the user object, but doesn't hold any data).
I have a way of getting round this, by initally renaming my original construct that accepts all the parameters, and then using the construct that doesn;t need parameters to create the object.
for example, this is how it works now (i've cut out a lot of the variables user for simplicity)
function user () { }
function user ($user, $password, $email) {
$this->setuser($user);
$this->setpassword($password);
$this->setemail($email);
}
I have to create the object like this:
$newuser = new user($user, $password, $email);
But I want to create a user, without passing any parameters in.. eg...
$newuser = new user();
I could use this to get around it:
$newuser = new user(null, null, null);
Any suggestions, or have I confused everyone?
Thanks.