当前位置: 首页>>代码示例>>PHP>>正文


PHP UserDAO::update方法代码示例

本文整理汇总了PHP中UserDAO::update方法的典型用法代码示例。如果您正苦于以下问题:PHP UserDAO::update方法的具体用法?PHP UserDAO::update怎么用?PHP UserDAO::update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UserDAO的用法示例。


在下文中一共展示了UserDAO::update方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: update

 public function update($user)
 {
     $userDAO = new UserDAO();
     //now build the array represting the php object...
     $fields = array('user_type' => $user->getUserType(), 'username' => $user->getUsername(), 'user_password' => $user->getUserpassword(), 'user_full_name' => $user->getUserFullName(), 'user_status' => $user->getUserStatus(), 'email' => $user->getEmail(), 'user_last_valid_login' => $user->getUserLastValidLogin(), 'user_first_invalid_login' => $user->getUserFirstInvalidLogin(), 'user_faild_login_count' => $user->getUserFailedLoginCount(), 'user_create_date' => $user->getUserCreateDate(), 'modified_by' => $user->getModifiedBy(), 'modification_date' => $user->getModificationDate());
     $userDAO->update($user->getUserId(), $fields);
 }
开发者ID:jaags,项目名称:satellite,代码行数:7,代码来源:User.php

示例2:

        if ($_POST['email'] != $user->getEmail()) {
            $user->setEmail($_POST['email']);
            $modified = true;
        }
        $_POST['birthDate'] = $_POST['yBirthDate'] . '-' . $_POST['mBirthDate'] . '-' . $_POST['dBirthDate'];
        if ($_POST['birthDate'] != $user->getBirthDate()) {
            $user->setBirthDate($_POST['birthDate']);
            $modified = true;
        }
        if ($_POST['address'] != $user->getAddress()) {
            $user->setAddress($_POST['address']);
            $modified = true;
        }
        if ($_POST['postalCode'] != $user->getPostalCode()) {
            $user->setPostalCode($_POST['postalCode']);
            $modified = true;
        }
        if ($_POST['city'] != $user->getCity()) {
            $user->setCity($_POST['city']);
            $modified = true;
        }
        if ($_POST['phoneNumber'] != $user->getPhoneNumber()) {
            $user->setPhoneNumber($_POST['phoneNumber']);
            $modified = true;
        }
        if ($modified) {
            UserDAO::update($user);
        }
    }
}
$presenter->data['user'] =& $user;
开发者ID:RobinDumontChaponet,项目名称:cocktails,代码行数:31,代码来源:profile.presenter.php

示例3: authorize

    echo json_encode($userDAO->selectById($id), JSON_NUMERIC_CHECK);
    exit;
});
$app->get('/users/login/:mail/?', authorize(), function ($mail) use($userDAO) {
    header("Content-Type: application/json");
    echo json_encode($userDAO->selectByMail($mail), JSON_NUMERIC_CHECK);
    exit;
});
$app->post('/users/?', authorize(), function () use($app, $userDAO) {
    header("Content-Type: application/json");
    $post = $app->request->post();
    if (empty($post)) {
        $post = (array) json_decode($app->request()->getBody());
    }
    echo json_encode($userDAO->insert($post), JSON_NUMERIC_CHECK);
    exit;
});
$app->delete('/users/:id/?', authorize(), function () use($userDAO) {
    header("Content-Type: application/json");
    echo json_encode($userDAO->delete());
    exit;
});
$app->put('/users/:id/?', function ($id) use($app, $userDAO) {
    header("Content-Type: application/json");
    $post = $app->request->post();
    if (empty($post)) {
        $post = (array) json_decode($app->request()->getBody());
    }
    echo json_encode($userDAO->update($id, $post), JSON_NUMERIC_CHECK);
    exit;
});
开发者ID:jessjoanna,项目名称:Photochallenge,代码行数:31,代码来源:users.php

示例4: execute

 function execute()
 {
     $user = json_decode($_GET['user']);
     $dao = new UserDAO();
     $dao->update($user);
 }
开发者ID:nazarmsx,项目名称:Simple-Blog,代码行数:6,代码来源:databaseoperations.php


注:本文中的UserDAO::update方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。