I would like to know if it's recommended to do this:
class User {
public function __construct() {
parent::__construct();
}
public function exists($token) {
//return true if token exists otherwise return false
}
public function createSession($token) {
if($this->exists($token))
//create session
else
//redirect
}
}
I think it could be not recommended in case of a change in the exists method of the class but I think that'll not happen, What do you recommend me to do?