getElementsByTagName("balmon"); for ($i=0; $i<$balmonlist->length; $i++) { $balmon = $balmonlist->item($i); $id_node = $balmon->attributes->getNamedItem("id"); $name_node = $balmon->getElementsByTagName("name")->item(0); $unconfirmed = $balmon->getElementsByTagName("uncfd_asta_bal")->item(0); $confirmed = $balmon->getElementsByTagName("cfd_asta_bal")->item(0); self::$monList[] = new BalMon($id_node->nodeValue,"$name_node->textContent","$unconfirmed->textContent","$confirmed->textContent"); } } return self::$monList; } static function getInstance($id) { $l_mon_li = self::getAllInstances(); foreach($l_mon_li as $monitor) { if($monitor->id == $id) return $monitor; } return null; } static function requireInstance($id) { $inst = self::getInstance($id); if($inst==null) throw new Exception("inst == null"); return $inst; } var $id; // Balance monitor ID (numerical) var $name; // identifier (i.e. a text string) var $uncfmd; // unconfirmed alarms var $cfmd; // confirmed alarms function __construct($id,$name,$uncfmd,$cfmd) { $this->id = $id; $this->name = $name; $this->uncfmd = $uncfmd; $this->cfmd = $cfmd; } }