/**
  * @param string $message
  * @param null $code
  * @param null $previous
  */
 public function __construct($message, $code = null, $previous = null)
 {
     if (is_array($code)) {
         if (isset($code['paramName'])) {
             $this->_paramName = $code['paramName'];
         }
     }
     parent::__construct($message, $code, $previous);
 }
 public function __toString()
 {
     $str = parent::__toString();
     if ($this->_entity) {
         $str .= "\nEntity: " . $this->_entity;
     }
     if (!empty($this->_validationErrors)) {
         $str .= "\nValidation errors:\n" . \Zend_Json::prettyPrint(\Zend_Json::encode($this->_validationErrors), array("indent" => "  "));
     }
     return $str;
 }