Updated ninja spyc test package to require http-api
[ninja.git] / modules / orm / libraries / ORMException.php
blob87f7b56d1af9a26cc709f49bfd5588331c6f052a
1 <?php
3 /**
4 * Exception for ORM
5 */
6 class ORMException extends Exception {
7 private $table = false;
8 private $field = false;
10 /**
11 * initialization of the ORMExcetpion
13 * @param $msg message to print
14 * @param $table related table, or false
15 * @param $field related field, or false
17 public function __construct( $msg, $table = false, $field = false ) {
18 $message = $msg;
19 $this->table = $table;
20 $this->field = $field;
21 if( $table )
22 $msg .= "Table: ".$table;
23 if( $field )
24 $msg .= "Field: ".$field;
25 parent::__construct($msg);
28 /**
29 * Get the table name related to the exception, or false
30 * @return table name, or false
32 public function getTable() {
33 return $this->table;
36 /**
37 * Get the field name related to the exception, or false
38 * @return field name, or false
40 public function getField() {
41 return $this->field;