當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。