MaketRandevu/src/engine/Api/V1/Exception.php

57 lines
1.4 KiB
PHP
Raw Normal View History

<?php
2016-07-09 13:25:21 +03:00
/* ----------------------------------------------------------------------------
* Easy!Appointments - Open Source Web Scheduler
*
* @package EasyAppointments
* @author A.Tselegidis <alextselegidis@gmail.com>
* @copyright Copyright (c) 2013 - 2018, Alex Tselegidis
2016-07-09 13:25:21 +03:00
* @license http://opensource.org/licenses/GPL-3.0 - GPLv3
* @link http://easyappointments.org
* @since v1.2.0
* ---------------------------------------------------------------------------- */
namespace EA\Engine\Api\V1;
2016-07-09 13:25:21 +03:00
/**
* API v1 Exception Class
*
* This exception variation will hold the information needed for exception handling in the API.
2016-07-09 13:25:21 +03:00
*/
class Exception extends \Exception {
/**
* Header Description
2016-07-09 13:25:21 +03:00
*
* e.g. 'Unauthorized'
*
2016-07-09 13:25:21 +03:00
* @var string
*/
protected $header;
/**
* Class Constructor
2016-07-09 13:25:21 +03:00
*
* @link http://php.net/manual/en/class.exception.php
*
* @param string $message
2016-07-09 13:25:21 +03:00
* @param int $code
* @param string $header
* @param \Exception|null $previous
2016-07-09 13:25:21 +03:00
*/
public function __construct($message = NULL, $code = 500, $header = '', \Exception $previous = NULL)
{
2016-07-09 13:25:21 +03:00
parent::__construct($message, $code, $previous);
$this->header = $header;
}
/**
* Get the header string.
*
2016-07-09 13:25:21 +03:00
* @return string
*/
public function getHeader()
{
2016-07-09 13:25:21 +03:00
return $this->header;
}
}