Пример #1
0
 function __destruct()
 {
     if ($this->db->inTransaction() && is_resource($this->db->getLink())) {
         $this->closeCursor();
         $this->closeTransaction();
     }
 }
Пример #2
0
 protected function getLink()
 {
     if (!$this->db) {
         throw new WrongStateException('Expected setted db');
     }
     if (!$this->db->isConnected()) {
         $this->db->connect();
     }
     return $this->db->getLink();
 }