Ejemplo n.º 1
0
Archivo: model.php Proyecto: nemis/Fm
 public function __construct($table_name, $id = 0, &$db = false)
 {
     if ($id > 0) {
         $this->bean = R::load($table_name, $id);
     } else {
         $this->bean = R::dispense($table_name);
     }
     $this->table_name = $table_name;
     $this->db = $db;
     if ($id > 0) {
         $this->load($id);
     }
     $this->fields = Fm::config('models.' . $table_name);
 }