コード例 #1
0
ファイル: UserMapper.php プロジェクト: robliuning/Luckyrabbit
	public function find($userId,System_Models_User $user)
	{
		$resultSet = $this->getDbTable()->find($userId);

		if (0 == count($resultSet)) {

			return;
		}

		$row = $resultSet->current();

		$user->setId($row->id)
				->setUserName($row->username)
				->setGroupId($row->groupId)
				->setPassword($row->password)
				->setSalt($row->salt)
				->setContactId($row->contactId)
				->setCreatorId($row->creatorId);
		$creatorCid = $this->getContactId($user->getCreatorId());
		$contacts = new Employee_Models_ContactMapper();
		$contactName = $contacts->findContactName($user->getContactId());
		$creatorCname = $contacts->findContactName($creatorCid);
		$user->setContactName($contactName);
		$user->setCreatorCid($creatorCid);
		$user->setCreatorCname($creatorCname);
		$ugs = new System_Models_UsergroupMapper();
		$groupName = $ugs->getGroupName($user->getGroupId());
		$user->setGroupName($groupName);
	}