<?php
class Document_View_Helper_GetUser extends Zend_View_Helper_Abstract {
	public function getUser($userId) {
		static $tableUsers = null;
		static $userList = array();
		
		if (is_null($tableUsers)) {
			$tableUsers = new Application_Model_Users();
		}
		
		if (isset($userList[$userId]))
			return $userList[$userId];
		
		$user = $tableUsers->find($userId)->current();
		
		$userList[$userId] = $user;
		
		return $user;
	}
}