public function __destruct() { if (!empty($this->logUpdates)) { $this->backup(); $this->logUpdates = array(); } parent::__destruct(); }