Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions
Zend_Db_Adapter_Sqlsrv_Exception Class Reference
Inheritance diagram for Zend_Db_Adapter_Sqlsrv_Exception:
Zend_Db_Adapter_Exception Zend_Db_Exception Zend_Exception

Public Member Functions

 __construct ($message=null, $code=0)
 
- Public Member Functions inherited from Zend_Db_Adapter_Exception
 __construct ($message='', $code=0, Exception $e=null)
 
 hasChainedException ()
 
 getChainedException ()
 
- Public Member Functions inherited from Zend_Exception
 __construct ($msg='', $code=0, Exception $previous=null)
 
 __call ($method, array $args)
 
 __toString ()
 

Additional Inherited Members

- Protected Member Functions inherited from Zend_Exception
 _getPrevious ()
 
- Protected Attributes inherited from Zend_Db_Adapter_Exception
 $_chainedException = null
 

Detailed Description

Definition at line 37 of file Exception.php.

Constructor & Destructor Documentation

◆ __construct()

__construct (   $message = null,
  $code = 0 
)

Constructor

If $message is an array, the assumption is that the return value of sqlsrv_errors() was provided. If so, it then retrieves the most recent error from that stack, and sets the message and code based on it.

Parameters
null | array | string$message
null | int$code

Definition at line 49 of file Exception.php.

50  {
51  if (is_array($message)) {
52  // Error should be array of errors
53  // We only need first one (?)
54  if (isset($message[0])) {
55  $message = $message[0];
56  }
57 
58  $code = (int) $message['code'];
59  $message = (string) $message['message'];
60  }
61  parent::__construct($message, $code, new Exception($message, $code));
62  }
$message
$code
Definition: info.phtml:12

The documentation for this class was generated from the following file: