<?php

class Table extends View implements IReadableView {



	protected $package = 'core-table';
	protected $columns = array();



	public function setupColumn($field, TableColumn $tc) {
		$this->columns[$field] = $tc;
		if (!$this->ctrl) {
			throw new Exception('specify controller before setting up columns');
		}
		$tc->ctrl = $this->ctrl;
	}



	public function getColumns() {
		return new ArrayObject($this->columns);
	}



	public function valueReader() {
		return "Table.getValue('{$this->id}', 'value')";
	}



	public function errorMessage($message) {
throw new Exception('FIXME!');
	}



	public function clearError() {
throw new Exception('FIXME!');
	}



} // class Table

?>