本文整理汇总了PHP中UserDao::completeRegistration方法的典型用法代码示例。如果您正苦于以下问题:PHP UserDao::completeRegistration方法的具体用法?PHP UserDao::completeRegistration怎么用?PHP UserDao::completeRegistration使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserDao
的用法示例。
在下文中一共展示了UserDao::completeRegistration方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
<?php
$errors = array();
$userObj = new User();
$addressObj = new Address();
$orderObj = new Order();
if (array_key_exists('submit', $_POST)) {
$userData = array('id' => (int) $_SESSION['user_id'], 'first_name' => $_POST['user']['first_name'], 'last_name' => $_POST['user']['last_name']);
$addressData = array('street_no' => $_POST['address']['street_no'], 'street' => $_POST['address']['street'], 'suburb' => $_POST['address']['suburb'], 'city' => $_POST['address']['city'], 'post_code' => $_POST['address']['post_code']);
UserMapper::map($userObj, $userData);
AddressMapper::map($addressObj, $addressData);
//$errors = Validator::validate($userObj);
//if (empty($errors)) {
$userDao = new UserDao();
$addressDao = new AddressDao();
// $_SESSION['address_id'] = ($addressDao->create($addressObj)->getId());
$userDao->completeRegistration($userObj, $addressDao->createAddress($addressObj)->getId());
//}
}
if (array_key_exists('order', $_POST)) {
$orderData = array('order_details' => $_POST['orders']['order_details'], 'order_date' => $_POST['orders']['order_date'] . '00:00:00');
OrderMapper::map($orderObj, $orderData);
$orderDao = new OrderDao();
$orderDao->createOrder($orderObj);
}