<?php

Doo::loadCore('db/DooModel');

class Musers extends DooModel {

    public $id;
    public $username;
    public $password;
    public $groups;
    public $salt;
    public $_table = 'zh_manager';
    public $_primarykey = 'id';
    public $_fields = array('id', 'username', 'password', 'groups', 'salt');

    public function __construct() {
	parent::setupModel(__CLASS__);
    }

    public function getCountz() {
	return $this->count();
    }

    public function getAll($limit) {
	return $this->find(array('limit' => $limit, 'asArray' => TRUE));
    }

    public function muserAdd($muserArray) {
	if (!is_array($muserArray))
	    return FALSE;
	$this->username = $muserArray['username'];
	$this->password = $muserArray['password'];
	$this->salt = $muserArray['salt'];
	$this->groups = $muserArray['groups'];
	return $this->insert();
    }

}

?>