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