當前位置: 首頁>>代碼示例>>PHP>>正文


PHP UserDao::selectUserById方法代碼示例

本文整理匯總了PHP中UserDao::selectUserById方法的典型用法代碼示例。如果您正苦於以下問題:PHP UserDao::selectUserById方法的具體用法?PHP UserDao::selectUserById怎麽用?PHP UserDao::selectUserById使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在UserDao的用法示例。


在下文中一共展示了UserDao::selectUserById方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: modifyUser

 public function modifyUser()
 {
     $username = $_POST['userName'];
     $userLastName = $_POST['userLastName'];
     $userPassword = $_POST['password'];
     $passwordAgain = $_POST['rePassword'];
     $userDao = new UserDao();
     $userInfoDao = new UserInfoDao();
     $uid = getUID();
     $user = $userDao->selectUserById($uid);
     $user->lastName = $userLastName;
     $user->password = $userPassword;
     $user->name = $username;
     User::readProperties($user, $_POST);
     $user->setInstitutionName($_POST['InstitutionName']);
     $userDao->updateUser($user, $uid);
     $userInfoDao->modifyUserInfo($id, $user);
 }
開發者ID:laiello,項目名稱:qnet-ua2011,代碼行數:18,代碼來源:modifyUserController.php

示例2: dirname

<div id="wrapper">
    <?php 
include "fragment/header.php";
?>
    <?php 
require_once dirname(__FILE__) . '\\..\\util.php';
require_controller("sessionController");
require_dao('userDAO');
require_model("User");
use Qnet\Dao\UserDAO;
use Qnet\Model\User;
use Qnet\Controller\SessionController;
$userDaoInstance = new UserDao();
$sc = new SessionController();
$uid = $sc->getUID();
$userInstance = $userDaoInstance->selectUserById($uid);
$username = $userInstance->getName();
$lastName = $userInstance->getLastName();
$userPassword = $userInstance->getPassword();
$gender = $userInstance->gender;
$maritalStatus = $userInstance->maritalSt;
$studies = $userInstance->studies;
$institutionName = $userInstance->InstitutionName;
$country = $userInstance->country;
$religion = $userInstance->getReligion();
?>

    <div id="page">
        <div id="content">
            <div class="post">
                <h2 class="title">Modify your information here please</h2>
開發者ID:laiello,項目名稱:qnet-ua2011,代碼行數:31,代碼來源:modifyUser.php

示例3: dirname

<?php

/**
 * Created by IntelliJ IDEA.
 * User: Tomas Alabes
 * Date: 15/09/2010
 * Time: 18:42:45
 * To change this template use File | Settings | File Templates.
 */
require_once dirname(__FILE__) . '\\..\\util.php';
require_dao('userDao');
use Qnet\Dao\UserDAO;
$userDao = new UserDao();
$uid = 1;
$user = $userDao->selectUserById($uid);
$user->lastName = "Gimenez";
$user->password = "dg";
$user->name = "Daniel";
$userDao->updateUser($user, $uid);
$userUpdated = $userDao->selectUserById($uid);
if ($userUpdated->password != $user->password || $userUpdated->lastName != $user->lastName || $userUpdated->name != $user->name) {
    echo "can not update user";
}
開發者ID:laiello,項目名稱:qnet-ua2011,代碼行數:23,代碼來源:modifyUserTest.php


注:本文中的UserDao::selectUserById方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。