in_tx = false; $this->obj = array(); } public function in_tx() { return $this->in_tx; } public function register($obj) { $this->obj[] = $obj; } public function begin() { $this->in_tx = true; foreach($this->obj as $v) $v->begin(); } public function commit() { $this->in_tx = false; foreach($this->obj as $v) $v->commit(); } public function rollback() { $this->in_tx = false; foreach($this->obj as $v) $v->rollback(); } } ?>