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


PHP UserDao::save方法代码示例

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


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

示例1: subscribe

 public function subscribe(User $user, $confirm_pass)
 {
     if ($user->password() == $confirm_pass) {
         return $this->dao->save($user);
     } else {
         throw new Exception('Senhas informadas não conferem');
     }
 }
开发者ID:raigons,项目名称:bureauinteligencia,代码行数:8,代码来源:UserController.php

示例2: createUser

 static function createUser($nickname, $email, $password, $role)
 {
     $pwd = Filter::encodePassword($password);
     $user = new User($nickname, $email, $pwd);
     $user->setRole($role);
     $userdao = new UserDao();
     $u = $userdao->save($user);
     //invia una mail per permettere all'utente di convalidare la sua casella.
     $code = self::generateValidationCode($u);
     mail($u->getEMail(), "Iscrizione a IoEsisto", self::generateValidationMailMessage($code));
     //genera una collection di preferiti
     require_once 'manager/CollectionManager.php';
     $data = array("title" => "Preferiti", "author" => $u->getID(), "categories" => "favourites", "visible" => false, "type" => "collection");
     //TODO la collection viene creata nel db ma da fatal error, forse il problema è nell'override di setContent dove controlla che si stia inserendo un post ma il contenuto è false
     //CollectionManager::createCollection($data);
     //TODO creare MailManager
     //genera tre directory email: mailbox, cestino e spam
     //require_once("manager/MailManager.php");
     //MailManager::createDirectory(MAILBOX, $u->getID());
     //MailManager::createDirectory(TRASH, $u->getID());
     //MailManager::createDirectory(SPAM, $u->getID());
     return $u;
 }
开发者ID:Esisto,项目名称:IoEsisto,代码行数:23,代码来源:UserManager.php

示例3: save

        }
    }
    public function save($userName, $userPwd)
    {
        try {
            $sql = "insert into user values(?,?,?)";
            //set the time format
            $rTime = date("Y-m-d h:i:s");
            //begin the transaction
            $this->pdo->beginTransaction();
            $stmt = $this->pdo->prepare($sql);
            $stmt->bindParam(1, $userName, PDO::PARAM_STR);
            $stmt->bindParam(2, $userPwd, PDO::PARAM_STR);
            $stmt->bindParam(3, $rTime, PDO::PARAM_STR);
            $stmt->execute();
            //there is no tips when occures the commit
            $this->pdo->commit();
            //show results
            //$this->testConn();
            //close the database
            $this->dbUtil->close();
        } catch (PDOException $e) {
            echo date("Y-m-d h:i:s") . " :Fail:" . $e->getMessage();
        }
    }
}
//main test
$userDao = new UserDao();
//$userDao->testConn();
$userDao->save('matrix', '121550');
开发者ID:KingBlacker,项目名称:SynCloudServer,代码行数:30,代码来源:UserDao.php

示例4: array

<?php

$errors = array();
$User = null;
$edit = array_key_exists('id', $_GET);
if ($edit) {
    $User = Utils::getUserByGetId();
} else {
    // set defaults
    $User = new User();
    //$User->setDate(new DateTime());
}
if (array_key_exists('cancel', $_POST)) {
} elseif (array_key_exists('save', $_POST)) {
    $data = array('email' => $_POST['Users']['email'], 'password' => $_POST['Users']['password']);
    // map
    UserMapper::map($User, $data);
    // validate
    $errors = UserValidator::validate($User);
    // validate
    if (empty($errors)) {
        // save
        $dao = new UserDao();
        $User = $dao->save($User);
        Flash::addFlash('Success Booking :)');
        // redirect
        Utils::redirect('home');
    }
}
开发者ID:beshad,项目名称:dropoff_22nov,代码行数:29,代码来源:home-script.php

示例5: UserDao

<?php

//status of list
$status = Utils::getUrlParam('status');
//command
$cmd = Utils::getUrlParam('cmd');
$flightBooking = Utils::getUserByGetId();
$flightBooking->setStatus($cmd);
$dao = new UserDao();
$dao->save($flightBooking);
$msg = '';
if ($cmd === User::VOIDED) {
    $smg = 'User deleted successfully.';
} else {
    $smg = 'User changed successfully.';
}
Flash::addFlash($smg);
Utils::redirect('list', array('status' => $status));
开发者ID:beshad,项目名称:dropoff_test_26NOV_0003,代码行数:18,代码来源:change-status-script.php

示例6: array

<?php

$errors = array();
$user = null;
$edit = array_key_exists('id', $_GET);
if ($edit) {
    $user = Utils::getUserByGetId();
} else {
    $user = new User();
}
if (array_key_exists('cancel', $_POST)) {
} elseif (array_key_exists('save', $_POST)) {
    $data = array('first_name' => $_POST['user']['first_name'], 'user_password' => $_POST['user']['user_password']);
    // map
    UserMapper::map($user, $data);
    // validate
    $errors = UserValidator::validate($user);
    // validate
    if (empty($errors)) {
        // save
        $dao = new UserDao();
        $user = $dao->save($user);
        Flash::addFlash('Success sign in :)');
        // redirect
        Utils::redirect('home');
    }
}
开发者ID:beshad,项目名称:dropoff_test_26NOV_0003,代码行数:27,代码来源:home-script.php


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