PHP Classes
elePHPant
Icontem

File: src/Exception/ConstructorFailed.php

Recommend this page to a friend!
  Classes of Scott Arciszewski  >  EasyDB  >  src/Exception/ConstructorFailed.php  >  Download  
File: src/Exception/ConstructorFailed.php
Role: Class source
Content type: text/plain
Description: Exception
Class: EasyDB
Simple Database Abstraction Layer around PDO
Author: By
Last change: Allow the original exception to be extracted from ConstructorFailed.

Fixes #107. Alternative to #108.
Date: 1 month ago
Size: 686 bytes
 

Contents

Class file image Download
<?php
namespace ParagonIE\EasyDB\Exception;

use
ParagonIE\Corner\CornerTrait;

/**
 * ConstructorFailed.
 *
 * @package ParagonIE\EasyDB
 */
class ConstructorFailed extends \RuntimeException implements ExceptionInterface
{
    use
CornerTrait;

   
/** @var \PDOException|null $realException */
   
private $realException = null;

   
/**
     * @param \PDOException $ex
     * @return ConstructorFailed
     */
   
public function setRealException(\PDOException $ex): self
   
{
       
$this->realException = $ex;
        return
$this;
    }

   
/**
     * @return \PDOException|null
     */
   
public function getRealException()
    {
        return
$this->realException;
    }
}