public function detectHeresie() { $etapes = $this->getRootDom()->getElementsByTagName('ETAPE'); //liste de nodes //on s'arrête à la dernière étape non validée $derniereEtapeNonFinie = null; foreach ($etapes as $etape) { if ($etape->getAttribute('etat') != 'fini') { $derniereEtapeNonFinie = $etape; } } //detection heresie non finitude $oldstate = formxTools::getDomState($this); if (!$derniereEtapeNonFinie && $oldstate != 'F' && $oldstate != 'H') { $state = $this->getAndCloseState(); formxTools::setDomState($this, $state); $this->saveInstance(); } }