Ejemplo n.º 1
0
 public function connect()
 {
     $throwEx = null;
     foreach ($this->adapters as $adapter) {
         try {
             var_dump('tentou por ' . get_class($adapter));
             return $adapter->connect();
         } catch (TransferException $ex) {
             $throwEx = TransferException::chain($throwEx, $ex);
         }
     }
     // se todos derem erro, lança exception de todos erros
     if (null !== $throwEx) {
         throw $throwEx;
     }
 }