I want to call the __construct function again in my class
something like this:
class user{
function __construct($ID = null)
{
if($ID){
//code
}
function findUser()
{
//code
$this->__construct($ID);
}
}
of course this does not work, but what is the correct way to do this?
If you want to overwrite the current values in the current instance, I would do this:
class user{
function __construct($ID = null)
{
$this->reinit($ID);
}
function reinit($id)
{
if($id) {
//code
}
}
}