本文整理汇总了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');
}
示例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);
}
}
示例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 :)');
}
}