本文整理汇总了PHP中Model_Users::saveUser方法的典型用法代码示例。如果您正苦于以下问题:PHP Model_Users::saveUser方法的具体用法?PHP Model_Users::saveUser怎么用?PHP Model_Users::saveUser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Model_Users
的用法示例。
在下文中一共展示了Model_Users::saveUser方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addeditAction
/**
* Function addeditAction for add and edit the user's information.
*/
public function addeditAction()
{
$asUser = Zend_Json_Decoder::decode($this->getRequest()->getParam('ssUserDetail'), Zend_Json::TYPE_ARRAY);
if ($asUser['id_user'] == 0) {
$oUser = new Model_Users();
$oUser->saveUser($asUser);
} else {
$oUser = Model_UsersTable::updateUser($asUser);
}
$asResponse = array('status' => 'success', 'massage' => 'Record added or edited successfully');
echo Zend_Json_Encoder::encode($asResponse);
exit;
}
示例2: addeditAction
/**
* Function addeditAction for add and edit the user's information.
*/
public function addeditAction()
{
$oForm = new Application_Form_AddUsers();
$oForm->submit->setLabel('Save');
if ($this->getRequest()->getParam('id') != '' && is_numeric($this->getRequest()->getParam('id'))) {
unset($oForm->password);
}
if ($this->getRequest()->isPost()) {
if ($oForm->isValid($this->getRequest()->getPost())) {
if ($this->getRequest()->getParam('id_user') > 0) {
$oUser = Model_UsersTable::updateUser($oForm->getValues());
} else {
$oUser = new Model_Users();
$oUser->saveUser($oForm->getValues());
}
$this->_redirect('/user/list');
}
} elseif ($this->getRequest()->getParam('id') != '') {
$oUser = Model_UsersTable::findUser($this->getRequest()->getParam('id'));
$oForm->populate($oUser[0]);
}
$this->view->snIdUser = $this->getRequest()->getParam('id') ? $this->getRequest()->getParam('id') : '';
$this->view->form = $oForm;
}
示例3: testaddUserSuccessfully
/**
* For add user in user table
* When user array is provided
* @author Rashmi Upadhyay
* @access public
*/
public function testaddUserSuccessfully()
{
$user = new Model_Users();
$user->saveUser($this->adduser);
$this->assertTrue(true, "Record add successfully");
}