I'm trying to show users who have voted and who have not yet voted. To do this, I first collect the users who have already voted (certainly not very elegant). After that I try to remove these users from the list of all users. But I get an error message. Have anyone an idea where the fault is?
$datenbank = $this->wire('database');
$sql = "SELECT user_id, vote_id FROM pollino_votes WHERE ".$seitenID."=page_id";
foreach ($datenbank->query($sql) as $row) {
$teilnehmer = $users->get($row['user_id']);
$antwort = $pages->get($row['vote_id']);
echo "<tr>";
echo "<td>".$teilnehmer->nachname.", ".$teilnehmer->vorname."</td>";
echo "<td>".$antwort->title."</td>";
echo "</tr>";
// This first part works nice!
foreach ($users->find("start=0") as $nutzer) {
$nu = $nutzer->nachname.$nutzer->vorname;
$tn = $teilnehmer->nachname.$teilnehmer->vorname;
$nu->removeItems($tn);
echo $nu;
// Here comes the error message: Uncaught Error: Call to a member function removeItems() on string in ...
}
}