function apagaAbatimentos() { $oabat = new Abatimento(); $sql = "select * from ag_abatimento where idPagamento = " . $this->id; $rsabats = $oabat->getSQL($sql); $opartic = new Participante(); foreach ($rsabats as $key => $abat) { $opartic->getById($abat->participante->id); $abat->delete($abat->id); $opartic->atualiza_status(); } }