예제 #1
0
파일: main.php 프로젝트: nemni8/Munch
 public function action_index()
 {
     $kosher_options = Kohana::config('global.kosher_level');
     $payment_method = Kohana::config('global.payment_method');
     $categories = Kohana_ORM::factory('category')->where('model', '=', 'restaurant')->find_all()->as_array('id', 'name');
     $this->template->content = View::factory('site/main_index')->set('kosher_options', $kosher_options)->set('payment_method', $payment_method)->set('categories', $categories);
 }
 /**
  * wrapper for factory
  */
 public static function factory($model, $id = NULL)
 {
     // uppercase name
     $model = ucfirst($model);
     // create model
     $model = parent::factory($model, $id);
     // call hook
     Event::raise($model, Event::BEFORE_INIT, array('model' => $model));
     // call init in model
     if (method_exists($model, 'init')) {
         $model->init();
     }
     // call hook
     Event::raise($model, Event::AFTER_INIT, array('model' => $model));
     //return the model
     return $model;
 }
예제 #3
0
파일: ORM.php 프로젝트: HappyKennyD/teest
 public static function factory($model, $id = NULL)
 {
     $model = ucfirst($model);
     return parent::factory($model, $id);
 }
예제 #4
0
파일: orm.php 프로젝트: nergal/kohana-libs
 public static function factory($model, $id = NULL)
 {
     return parent::factory($model, $id);
 }