<?php

class ArrayDataSource extends DataSource {



	protected $id;
	public $data;



    public function fetch() {
		$orderColumn = $this->getOrder();
		if (!$orderColumn)
			return $this->data;

		$keys = array();
		foreach ($this->data as $i => $row) {
			$keys[$i] = $row[$orderColumn];
		}

		$this->isDescending() ? krsort($keys) : ksort($keys);
		$out = array();
		foreach ($keys as $k => $v) {
			$out[] = $this->data[$k];
		}
		return $out;
	}



} // class ArrayDataSource

?>