Non sono su una macchina con php per testarlo, ma hai query con variabili come segue...
"select id from votes where username = '$user' and article_id = $this->id"
Sono abbastanza certo che devi mettere tra parentesi o concatenare quando usi gli oggetti...
"select id from votes where username = '$user' and article_id = ${this->id}"
o
"select id from votes where username = '$user' and article_id = " . $this->id