public function activate($id) { $S = new Template($id); $S->changeA("aktiv", "1"); $this->addAssocV3("aktiv", "=", "1"); $this->addAssocV3("templateType", "=", $S->getA()->templateType); while ($t = $this->getNextEntry()) { $t->changeA("aktiv", "0"); $t->saveMe(); } $S->saveMe(); }