本文整理汇总了PHP中Account::update方法的典型用法代码示例。如果您正苦于以下问题:PHP Account::update方法的具体用法?PHP Account::update怎么用?PHP Account::update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Account
的用法示例。
在下文中一共展示了Account::update方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: signin
public function signin() {
$email = $this->f3->get('POST.email');
$password = $this->f3->get('POST.password');
$v = new Valitron\Validator(array('Email' => $email, 'Password' => $password));
$v->rule('required', ['Email', 'Password']);
$v->rule('email', 'Email');
if ($v->validate()) {
$account = new Account($this->db);
$pwd = md5($password);
$acc = $account->select("*", "email='$email' and password='$pwd'");
if ($acc) {
$this->f3->set('SESSION.acc', $acc);
$acc = $acc[0];
$acc['lastlogin'] = date('Y-m-d H:i:s');
$account->update($acc,'id='.$acc['id']);
$this->f3->reroute('/dashboard');
} else {
$this->f3->set('email', $email);
$this->f3->set('errors', array(array('Login fail, wrong username or password')));
echo Template::instance()->render('index.html');
}
} else {
$this->f3->set('email', $email);
$this->f3->set('errors', $v->errors());
echo Template::instance()->render('index.html');
}
}
示例2: testUpdateAccount
public function testUpdateAccount()
{
Client::relateIQ(GlobalVar::KEY, GlobalVar::SECRET);
$account = new Account(['id' => '55143b18e4b016fae539bd0b', 'name' => 'Account updated']);
$res = $account->update();
$this->assertInstanceOf('Account', $res);
$this->assertEquals('Account updated', $res->name());
}
示例3: testUpdateLegalEntity
public function testUpdateLegalEntity()
{
$response = $this->managedAccountResponse('acct_ABC');
$this->mockRequest('POST', '/v1/accounts', array('managed' => 'true'), $response);
$response['legal_entity']['first_name'] = 'Bob';
$this->mockRequest('POST', '/v1/accounts/acct_ABC', array('legal_entity' => array('first_name' => 'Bob')), $response);
$account = Account::create(array('managed' => true));
$account = Account::update($account['id'], array('legal_entity' => array('first_name' => 'Bob')));
$this->assertSame('Bob', $account->legal_entity->first_name);
}
示例4: CreateAccount
function CreateAccount($merchantAccountId, $email)
{
$account = new Account();
$account->setName('Migrated Customer');
$account->setMerchantAccountId($merchantAccountId);
// Be conscious that using real email addresses in ProdTest depending on configuration will
// have live emails triggered and sent on billing events for the Account.
// It is recommended that when testing in ProdTest be certain to mask real email addresses.
$account->setEmailAddress($email);
$account->setEmailTypePreference('html');
$account->setWarnBeforeAutoBilling(true);
$anyOtherHelpfulDataForCSRsWhenLookingUpAccount = new NameValuePair();
$anyOtherHelpfulDataForCSRsWhenLookingUpAccount->setName('HelpfulData');
$anyOtherHelpfulDataForCSRsWhenLookingUpAccount->setValue('BestCustomerEver');
$account->setNameValues(array($anyOtherHelpfulDataForCSRsWhenLookingUpAccount));
$address = new Address();
$address->setAddr1('303 Twin Dolphin Drive');
$address->setAddr2('Suite 200');
$address->setCity('Redwood City');
$address->setDistrict('CA');
$address->setPostalCode('94065');
$address->setCountry('US');
$address->setPhone('123-456-7890');
$srd = '';
$account->setShippingAddress($address);
$response = $account->update($srd);
// Log soap id for each API call.
// $log->addDebug('Method = Account.update' . PHP_EOL);
// $log->addDebug('Soap Id = ' . $response['data']->return->soapId . PHP_EOL);
// $log->addDebug('Return Code = ' . $response['returnCode'] . PHP_EOL);
// $log->addDebug('Return String = ' . $response['returnString'] . PHP_EOL);
if ($response['returnCode'] == 200) {
print "Call succeeded" . PHP_EOL;
} else {
print "Call failed" . PHP_EOL;
print_r($response);
}
}
示例5: displaySearchForm
displaySearchForm();
extract($_POST);
//account edited, update it
$database = connectToDatabase();
$account = new Account();
$account->loadFromDatabase($database_id, $database);
$account->setFirstName($first_name);
$account->setLastName($last_name);
$account->setMiddleInitial($middle_initial);
$account->setStreetAddress($street_address);
$account->setCity($city);
$account->setState($state);
$account->setZipCode($zip_code);
$account->setAreaCode($area_code);
$account->setPhoneNumber($phone_number);
$status = $account->update($database);
if ($status) {
echo "Account update successful!<br/>";
} else {
echo "Account could not be updated!<br/>";
}
} else {
if ($_POST['submitted']) {
displaySearchForm();
extract($_POST);
$search_name = str_replace("%", "\\%", $search);
$search_name = str_replace("_", "\\_", $search_name);
$search_name = str_replace("*", "%", $search_name);
$search_name = str_replace("?", "_", $search_name);
$database = connectToDatabase();
$query = "SELECT *\n FROM " . $tables['accounts'] . "\n WHERE last_name LIKE '" . $search_name . "' OR\n first_name LIKE '" . $search_name . "' OR\n email_address LIKE '" . $search_name . "' OR\n INSTR( username, '" . $search . "' ) > 0\n ORDER BY " . $sort_order;
示例6: testUpdate
public function testUpdate()
{
// the rows we are looking to update
$where = 'amount > ?';
$whereValues = array(1);
// id=1
$options = array('limitMax' => 1);
$values = array('id' => 1, 'name' => 'Joe', 'amount' => 100);
// our mock adapter
$adapter = $this->adapterMock;
// prepare the mock to expect the variables passed, and return a row
$adapter->expects($this->once())->method('update')->with('accounts', $values, $where, $whereValues, $options)->will($this->returnValue(true));
$accountsTable = new Account($adapter);
// getInstance doesn't work well in testing
$result = $accountsTable->update($values, $where, $whereValues, $options);
$this->assertTrue($result);
}
示例7:
{
$message='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("AccountancyCode")).'</div>';
$action='edit'; // Force chargement page en mode creation
$error++;
}
if (empty($account->label))
{
$message='<div class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("LabelBankCashAccount")).'</div>';
$action='edit'; // Force chargement page en mode creation
$error++;
}
if (! $error)
{
$result = $account->update($user);
if ($result >= 0)
{
$_GET["id"]=$_POST["id"]; // Force chargement page en mode visu
}
else
{
$message='<div class="error">'.$account->error.'</div>';
$action='edit'; // Force chargement page edition
}
}
}
if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == "yes" && $user->rights->banque->configurer)
{
// Modification
示例8: process_request
protected final function process_request()
{
// Process
//
if ($this->request_noun === REQUEST_NOUN_USERS) {
if ($this->request_verb === 'show') {
// Show
//
if (count($this->inputter->additional_uri_arguments) === 1 && isset($this->inputter->additional_uri_arguments[0]) && $this->http_method === HTTP_METHOD_GET) {
Users::show($this->inputter, $this->outputter);
} else {
$this->invalid_process_additional_argument(count($this->inputter->additional_uri_arguments) - 1);
}
} else {
if ($this->request_verb === 'search' && $this->http_method === HTTP_METHOD_GET) {
// Search
//
Users::search($this->inputter, $this->outputter);
} else {
if ($this->request_verb === 'lookup' && $this->http_method === HTTP_METHOD_GET) {
// Lookup
//
Users::lookup($this->inputter, $this->outputter);
} else {
$this->invalid_process_verb();
}
}
}
} else {
if ($this->request_noun === REQUEST_NOUN_FRIENDS) {
if ($this->request_verb === 'list' && $this->http_method === HTTP_METHOD_GET) {
// List
//
Friends::_list($this->inputter, $this->outputter);
} else {
if ($this->request_verb === 'ids' && $this->http_method === HTTP_METHOD_GET) {
// User IDs
//
Friends::ids($this->inputter, $this->outputter);
} else {
$this->invalid_process_verb();
}
}
} else {
if ($this->request_noun === REQUEST_NOUN_FOLLOWERS) {
if ($this->request_verb === 'list' && $this->http_method === HTTP_METHOD_GET) {
// List
//
Followers::_list($this->inputter, $this->outputter);
} else {
if ($this->request_verb === 'ids' && $this->http_method === HTTP_METHOD_GET) {
// User IDs
//
Followers::ids($this->inputter, $this->outputter);
} else {
$this->invalid_process_verb();
}
}
} else {
if ($this->request_noun === REQUEST_NOUN_IN_PRODUCT_PROMOTIONS) {
if ($this->request_verb === 'show') {
// Show
//
if (count($this->inputter->additional_uri_arguments) === 1 && isset($this->inputter->additional_uri_arguments[0]) && $this->http_method === HTTP_METHOD_GET) {
// In Product Promotion ID
//
InProductPromotions::show($this->inputter, $this->outputter);
} else {
$this->invalid_process_additional_argument(count($this->inputter->additional_uri_arguments) - 1);
}
} else {
if ($this->request_verb === 'create' && $this->http_method === HTTP_METHOD_POST) {
// Create
//
InProductPromotions::create($this->inputter, $this->outputter);
} else {
if ($this->request_verb === 'update' && $this->http_method === HTTP_METHOD_POST) {
// Update
//
InProductPromotions::update($this->inputter, $this->outputter);
} else {
if ($this->request_verb === 'destroy') {
// Destroy
//
if (count($this->inputter->additional_uri_arguments) === 1 && isset($this->inputter->additional_uri_arguments[0]) && $this->http_method === HTTP_METHOD_DELETE) {
// In Product Promotion ID
//
InProductPromotions::destroy($this->inputter, $this->outputter);
} else {
$this->invalid_process_additional_argument(count($this->inputter->additional_uri_arguments) - 1);
}
} else {
$this->invalid_process_verb();
}
}
}
}
} else {
if ($this->request_noun === REQUEST_NOUN_INVITATIONS) {
if ($this->request_verb === 'show') {
//.........这里部分代码省略.........
开发者ID:adamcarter93,项目名称:university-final-year-project-rest-api,代码行数:101,代码来源:EventsRESTController.php
示例9: Session
<?php
/*
For security purpose, all ajax request check correspondance between user_token (store in a cookie) and user_id (also store in a cookie).
*/
include '../config.php';
$session = new Session($base->pdo);
$account = new Account($base->pdo);
// Set a new session when user connect
if ($_POST['action'] == 'new' && isset($_POST['lat']) && isset($_POST['long']) && isset($_POST['video_auto'])) {
if ($account->checkToken()) {
// Account is created everytime a new user connect (determinated via cookie)
// The account saves his name and description message
$account->update($_POST['login'], $_POST['message']);
// Then, a new session associated with the user is set
$session->set($_COOKIE['user_id'], $_POST['lat'], $_POST['long'], 2, $_POST['video_auto']);
$session->add();
}
}
if ($_POST['action'] == 'sync') {
if ($account->checkToken()) {
$session->activity($_COOKIE['user_id']);
}
}
if ($_POST['action'] == 'findpeer') {
if ($account->checkToken()) {
$session->find_peer($_COOKIE['user_id']);
}
}
示例10: update
function update($returnType = RETURN_BOOLEAN)
{
global $dbh;
$query = '
UPDATE
`userDetails`
SET
`name` = "' . $this->getName() . '"
WHERE
`uniqueID` = "' . $this->getUniqueID() . '"';
switch ($returnType) {
case RETURN_BOOLEAN:
default:
// return a boolean result
$returnValue = false;
try {
$statement = $dbh->prepare(parent::update(1));
$statement->execute();
$statement = $dbh->prepare($query);
$statement->execute();
$returnValue = true;
} catch (PDOException $e) {
print "Error[ 103 ]: " . $e->getMessage() . "<br/>";
die;
}
break;
case "1":
// return the query
$returnValue = $query;
break;
}
return $returnValue;
}