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