<?php
class Users extends Zend_Db_Table_Abstract {
	protected $_name = 'iso_users';
	protected $_primary = 'id_user';
	
	public function getUser($idUser)
	{
		$row = $this->fetchRow($this->select()->where('id_user = ?', $idUser));
		if ($row)
			return $row;
			
		return false;
	}
	
	public function generatePassword($lenght = 8)
	{
		$feed = 'abcdefghijklmnopqrstuvwxyz123456789';
		$pass = '';
		for ($i = 0; $i < $lenght; $i++)
		{
			$pass .= $feed[rand(0, strlen($feed))];
		}
		
		return $pass;	
	}
}
?>