<?php
 
/**
 
 * @package DATA
 
 */
 
 
/**
 
 * An exception thrown when trying to read a field that
 
 * doesn't exist on the table.
 
 */
 
class DATA_FieldDoesntExist extends DATA_Exception {
 
    /**
 
     * The table where the field wasn't found.
 
     * @var string
 
     */
 
    private $table;
 
    
 
    /**
 
     * The field that wasn't found.
 
     * @var string
 
     */
 
    private $field;
 
    
 
    /**
 
     * Default constructor.
 
     * @param string $table The table where the field wasn't found.
 
     * @param string $field The field that wasn't found.
 
     */
 
    function __construct($table, $field) {
 
        parent::__construct("Field '{$field}' doesn't exist in table '{$table}'.");
 
        $this->table = $table;
 
        $this->field = $field;
 
    }
 
    
 
    /**
 
     * Returns the table where the field wasn't found.
 
     * 
 
     * @return string The table where the field wasn't found.
 
     */
 
    function getTable() {
 
        return $this->table;
 
    }
 
    
 
    /**
 
     * Returns the field that wasn't found.
 
     * 
 
     * @return mixed The field that wasn't found.
 
     */
 
    function getField() {
 
        return $this->field;
 
    }
 
}
 
?>
 
 
 |