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


PHP UserDao::create方法代碼示例

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


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

示例1: inscription

 function inscription()
 {
     $erreur_array = array('name' => -1, 'description' => -1, 'contenu' => -1, 'from' => -1, 'to' => -1);
     $erreur = false;
     if ($_SERVER['REQUEST_METHOD'] === 'POST') {
         $array_user = $this->postLogin($erreur, $erreur_array);
         $nb = $this->userExist(array('email' => $array_user['user']['email']));
         if (!$erreur && !$nb) {
             $array_user['user']['is_verified'] = uniqid();
             $userDao = new UserDao(new User($array_user['user']));
             $userDao->create();
             //die(var_dump($array_services));
             $iduser = $userDao->getLastID();
             $array_user['adresse']['id_user'] = $iduser;
             $adresseDao = new AdresseDao(new Adresse($array_user['adresse']));
             $adresseDao->create();
             $mail = new Mail();
             $result = $mail->sendMailActivation('support@rp2m.com', $array_user['user']['email'], $array_user['user']['prenom'], $array_user['user']['is_verified']);
             if ($result['send']) {
                 $this->set(array('success' => '1'));
                 $this->render('inscription');
             }
         } elseif ($nb) {
             $this->set(array('success' => '2'));
             $this->render('inscription');
         } elseif ($erreur) {
             $this->render('inscription');
         }
     }
     $this->set(array('success' => '0'));
     $this->render('inscription');
 }
開發者ID:fallouseven,項目名稱:projet_rpm,代碼行數:32,代碼來源:Authentification.php

示例2: array

<?php

$errors = array();
$userObj = new User();
if (array_key_exists('signin', $_POST)) {
    $data = array('email' => $_POST['user']['email'], 'user_password' => $_POST['user']['user_password']);
    UserMapper::map($userObj, $data);
    $errors = Validator::validate($userObj);
    if (empty($errors)) {
        $dao = new UserDao();
        $_SESSION['user_id'] = $dao->create($userObj)->getId();
        Utils::redirect(dashboard);
    }
}
開發者ID:beshad,項目名稱:dropoff_30_nov_,代碼行數:14,代碼來源:home-script.php

示例3: array

<?php

$errors = array();
$user_obj = new User();
if (array_key_exists('add', $_POST)) {
    $data = array('first_name' => $_POST['user']['first_name'], 'user_password' => $_POST['user']['user_password']);
    UserMapper::map($user_obj, $data);
    $errors = UserValidator::validate($user_obj);
    if (empty($errors)) {
        $dao = new UserDao();
        $dao->create($user_obj);
        Flash::addFlash('1 user is added to db successfully :)');
    }
}
開發者ID:beshad,項目名稱:dropoff_practice_28NOV_2227,代碼行數:14,代碼來源:home-script.php


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