first import
[projectpier.git] / library / simplegd / errors / FailedToLoadImageError.class.php
blob0900fa584f6822c45763efcd6d7a924ee3d7417c
1 <?php
3 /**
4 * Failed to load image from file
6 * @version 1.0
7 * @http://www.projectpier.org/
8 */
9 class FailedToLoadImageError extends Error {
11 /**
12 * Path of the image
14 * @var string
16 protected $file_path;
18 /**
19 * Construct the FailedToLoadImageError
21 * @param string $file_path
22 * @param string $message If NULL default message will be used
23 * @return FileNotImageError
25 function __construct($file_path, $message = null) {
26 if(is_null($message)) $message = "Failed to load image from '$file_path'";
27 parent::__construct($message);
28 $this->setFilePath($file_path);
29 } // __construct
31 /**
32 * Return errors specific params...
34 * @access public
35 * @param void
36 * @return array
38 function getAdditionalParams() {
39 return array(
40 'file path' => $this->getFilePath()
41 ); // array
42 } // getAdditionalParams
44 // ---------------------------------------------------
45 // Getters and setter
46 // ---------------------------------------------------
48 /**
49 * Get file_path
51 * @param null
52 * @return string
54 function getFilePath() {
55 return $this->file_path;
56 } // getFilePath
58 /**
59 * Set file_path value
61 * @param string $value
62 * @return null
64 function setFilePath($value) {
65 $this->file_path = $value;
66 } // setFilePath
68 } // FailedToLoadImageError