<?php defined('SYSPATH') or die('No direct script access.');

class Model_Department extends ORM
{
    //protected $_has_many = array('sales' => array('model'=>'sale', 
     //                                            'through'=>'categorysales'));
     
    public function getDepartments(){
        
        $departments = ORM::factory('department')-> find_all();
        $departments_arr = array();
        foreach($departments as $department){
            $departments_arr [$department->id] = $department->departname;
        }
        return $departments_arr;
    }
}