Application cleanup

This commit is contained in:
Deon George
2013-05-10 20:48:10 +10:00
parent 970b2ef4f0
commit c0ba6d4e98
36 changed files with 284 additions and 544 deletions

View File

@@ -10,10 +10,14 @@
* @license http://dev.osbill.net/license.html
*/
class Model_Country extends ORM_OSB {
protected $_has_one = array(
'currency'=>array('far_key'=>'id'),
);
protected $_form = array('id'=>'id','value'=>'name');
public function currency() {
return ORM::factory('Currency')->where('country_id','=',$this->id)->find();
public static function icon() {
return HTML::image(sprintf('media/img/country/%s.png',strtolower($this->two_code)),array('alt'=>$this->currency->symbol));
}
}
?>