get_called_class(),':method'=>__METHOD__)); } /** * Display a static name for a value * * @param key $id value to render * @see _display() */ public static function display($value) { return static::_display($value); } // Due to static scope, sometimes we need to call this function from the child class. protected static function _display($id) { $table = static::factory()->table(); if (! $table OR empty($table[$id])) return sprintf('No Value (%s)',$id); else return $table[$id]; } /** * Renders form input * * @param string Form name to render * @param string Default value to populate in the Form input. */ public static function form($name,$default='',$addblank=FALSE) { $table = static::factory()->table(); if ($addblank) $table = array_merge(array(''=>' '),$table); return Form::Select($name,$table,$default); } } ?>