<?php

class mfUser extends mfBaseModel {
	private static $instance;
	public $data;
	
  
  public function __construct() {
    $this->db=FronkDB::singleton();
		$this->log=mfLoghandler::singleton();
		
		if(defined("MFMODEL_USEFIELDPREFIX") && MFMODEL_USEFIELDPREFIX==true) {
			$this->table=get_class($this);
		}
		
		if(method_exists($this, "init")) {
			$this->init($_);
		}
		
		if(is_numeric($_)) {
			$this->fetch($_);
		} elseif(is_object($_)) {
			$this->load($_);
		}
  }
  
	protected function init($user) {
    $this->table="user";
	}
	
	public static function singleton($user=null) {
			if(!isset(self::$instance)) {
			$c=__CLASS__;
			self::$instance=new $c($user);
		}
		return self::$instance;
	}
	
	
}