E' possibile recuperare il valore della variabile $row nella funzione checkIn dalla funzione badge?

Codice PHP:
class sqlClass{
    public function 
checkIn(){
        
$id "SELECT id FROM users WHERE username = '".$_SESSION['username']."'";
        
        
$resultId mysql_query($id) or die('Query failed: ' mysql_error());
        
        
$rowId mysql_fetch_row($resultId);
        
        
$row $rowId[0];
        
        
$sql "SELECT ingresso from ore where idusers = ".$row."";    
        
$ing mysql_query($sql) or die('Query failed: ' mysql_error());
        
        
$rowIng mysql_fetch_array($ing);
        
        
$ingresso 0;
        
        
        if (
$rowIng[0] > 0){
            
$ingresso 1;
        }
        
        return 
$rowIng[0];
    }
    
    public function 
badge(){        
        echo 
$this->checkIn();
    }