resolveException() публичный Метод

Устаревший:
public resolveException ( Exception | Throwable $e, string $query = NULL, array $params = [] ) : DBALException
$e Exception | Throwable
$query string
$params array
Результат DBALException
Пример #1
0
 /**
  * When entity have columns for required associations, this will fail.
  * Calls $em->flush().
  *
  * @todo fix error codes! PDO is returning database-specific codes
  *
  * @param object $entity
  * @throws \Doctrine\DBAL\DBALException
  * @throws \Exception
  * @return bool|object
  */
 public function persist($entity)
 {
     $this->db->beginTransaction();
     try {
         $persisted = $this->doInsert($entity);
         $this->db->commit();
         return $persisted;
     } catch (Doctrine\DBAL\Exception\UniqueConstraintViolationException $e) {
         $this->db->rollback();
         return FALSE;
     } catch (Kdyby\Doctrine\DuplicateEntryException $e) {
         $this->db->rollback();
         return FALSE;
     } catch (DBALException $e) {
         $this->db->rollback();
         if ($this->isUniqueConstraintViolation($e)) {
             return FALSE;
         }
         throw $this->db->resolveException($e);
     } catch (\Exception $e) {
         $this->db->rollback();
         throw $e;
     } catch (\Throwable $e) {
         $this->db->rollback();
         throw $e;
     }
 }