function __destruct() { if (isset($this->profile['single_transaction']) && $this->profile['single_transaction']) { $this->commit(); } parent::__destruct(); }