first import
[projectpier.git] / environment / classes / errors / filesystem / FileNotWriableError.class.php
blobc9d3083f38e281518ecc6f0e37a6d14414d264bd
1 <?php
3 /**
4 * This exception is thrown when we need to write content to the
5 * file and it is not writable
7 * @version 1.0
8 * @http://www.projectpier.org/
9 */
10 class FileNotWriableError extends Error {
12 /**
13 * Path of the requested file
15 * @var string
17 private $file_path;
19 /**
20 * Construct the FileNotWriableError
22 * @access public
23 * @param void
24 * @return FileNotWriableError
26 function __construct($file_path, $message = null) {
27 if(is_null($message)) $message = "File '$file_path' is not writable";
28 parent::__construct($message);
29 $this->setFilePath($file_path);
30 } // __construct
32 /**
33 * Return errors specific params...
35 * @access public
36 * @param void
37 * @return array
39 function getAdditionalParams() {
40 return array(
41 'file path' => $this->getFilePath()
42 ); // array
43 } // getAdditionalParams
45 // -------------------------------------------------------
46 // Getters and setters
47 // -------------------------------------------------------
49 /**
50 * Get file_path
52 * @access public
53 * @param null
54 * @return string
56 function getFilePath() {
57 return $this->file_path;
58 } // getFilePath
60 /**
61 * Set file_path value
63 * @access public
64 * @param string $value
65 * @return null
67 function setFilePath($value) {
68 $this->file_path = $value;
69 } // setFilePath
71 } // FileNotWriableError