本文整理匯總了PHP中Members::update方法的典型用法代碼示例。如果您正苦於以下問題:PHP Members::update方法的具體用法?PHP Members::update怎麽用?PHP Members::update使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Members
的用法示例。
在下文中一共展示了Members::update方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1:
/** @test */
function it_should_update_the_information_of_a_registered_member()
{
$member = $this->members->with(Identifier::fromString('wxyz'));
$member->transfer(Money::MXN(500), $this->existingMember);
$this->members->update($this->existingMember);
$this->assertBalanceAmounts(3500, $this->existingMember, "Current member balance should be 3500");
}
示例2:
$member['address'] = $_REQUEST['address'];
$member['nic'] = $_REQUEST['nic'];
$member['reg_no'] = $_REQUEST['reg_no'];
$member['sex'] = $_REQUEST['sex'];
$member['phone'] = $_REQUEST['phone'];
$member['email'] = $_REQUEST['email'];
$member['index_no'] = $_REQUEST['index_no'];
// username, password are updated separately
$member['username'] = 'Not Updated';
$member['password'] = 'Not Updated';
$member['login_type'] = $_REQUEST['login_type'];
$member['category'] = $_REQUEST['category'];
$member['barcode'] = 'Not Updated';
$member['expired'] = $_REQUEST['expired'];
$mem->update($member);
}
// Change Password /////////////////////////////////////////////////////
if(isset($_REQUEST['BtnChangePassword'])){
$member = $mem->getByID($_REQUEST['mid']);
$password = $_REQUEST['pwd'];
$mem->changePassword($member,$password);
} //END: Change Password
// Change Username /////////////////////////////////////////////////////
if(isset($_REQUEST['BtnChangeUsername'])){
$member = $mem->getByID($_REQUEST['mid']);
$username = $_REQUEST['username'];
$mem->changeUsername($member, $username);
示例3: updateAction
public function updateAction($id = null)
{
$memberData = Members::findFirstById($id);
if (!$memberData) {
$this->flash->error('<button type="button" class="close" data-dismiss="alert">×</button>Invalid Member.');
return;
}
if ($this->request->isPost()) {
$member = new Members();
$member->id = $id;
if ($member->update($_POST)) {
$this->flash->success('<button type="button" class="close" data-dismiss="alert">×</button>You profile has been updated.');
return $this->response->redirect();
}
}
$this->view->setVar('memberData', $memberData);
}