本文整理汇总了PHP中Account::setName方法的典型用法代码示例。如果您正苦于以下问题:PHP Account::setName方法的具体用法?PHP Account::setName怎么用?PHP Account::setName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Account
的用法示例。
在下文中一共展示了Account::setName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: store
/**
* Store a newly created resource in storage.
*
* @return Response
*/
public function store()
{
$account = new Account();
$account->setDomain(Input::get('domain'));
$account->setNit(Input::get('nit'));
$account->setName(Input::get('name'));
$account->setEmail(Input::get('email'));
// return $account->getErrorMessage();
if ($account->Guardar()) {
//redireccionar con el mensaje a la siguiente vista
Session::flash('mensaje', $account->getErrorMessage());
$direccion = "http://" . $account->domain . ".emizor.com";
//enviando correo de bienvenida
global $correo;
$correo = $account->getEmail();
// return Response::json($correo);
Mail::send('emails.bienvenida', array('direccion' => $direccion, 'name' => $account->getName(), 'nit' => $account->getNit()), function ($message) {
global $correo;
$message->to($correo, '')->subject('Emizor');
});
//
// $direccion = "/crear/sucursal";
return Redirect::to($direccion);
}
Session::flash('error', $account->getErrorMessage());
return Redirect::to('crear');
}
示例2: do_add
/**
* Adds a new acccount
*
* @param string $strName
* @param int $intDomainId
* @param string $strPassword
* @return int The user ID
*/
public function do_add($strName, $intDomainId, $strPassword)
{
$strName = strtolower($strName);
// Only letters, numbers and the dash symbol are allowed!
if (preg_match('/[^a-z0-9\\-]/', $strName) !== 0 || strlen($strName) > 45) {
throw new Exception('Invalid account name');
}
$account = new Account();
$account->setName($strName)->save();
return $account->getId();
}
示例3: store
/**
* Store a newly created resource in storage.
*
* @return Response
*/
public function store()
{
//
// return Response::json(Input::all());
$account = new Account();
// $account->ip = Request::getClientIp();
// $account->account_key = str_random(RANDOM_KEY_LENGTH);
//$account->setDomain(Input::get('domain'));
$account->setNit(Input::get('nit'));
$account->setName(Input::get('name'));
if ($account->Guardar()) {
$direccion = "http://cascada.ipx";
// $direccion = "/crear/sucursal";
return Redirect::to($direccion);
}
return Response::json(Input::all());
// Session::put('error',$account->getErrorMessage());
// return Redirect::('crear');
// $account->language_id = 1;
// $account->save();
// $user = new User;
// $username = trim(Input::get('username'));
// $user->username = $username . "@" . $account->domain;
// $user->password = Hash::make(trim(Input::get('password')));
// $user->public_id = 1;
// $user->confirmation_code = '';
// $user->is_admin = true;
// $account->users()->save($user);
// $category = new Category;
// $category->user_id =$user->getId();
// $category->name = "General";
// $category->public_id = 1;
// $account->categories()->save($category);
// $InvoiceDesign = new InvoiceDesign;
// $InvoiceDesign->user_id =$user->getId();
// $InvoiceDesign->logo = "";
// $InvoiceDesign->x = "5";
// $InvoiceDesign->y = "5";
// $InvoiceDesign->javascript = "";
// $account->invoice_designs()->save($InvoiceDesign);
// $admin = User::find($user->id);
// Auth::login($admin);
// $data = array('guardado exitoso' => ' se registro correctamente hasta aqui todo blue :)' ,'datos'=>Input::all());
// Session::put('account_id',$user->account_id);
// // return View::make('sucursales.edit')->with(array('account_id' => $user->account_id));
// return Redirect::to('cuentas');
}
示例4: create_ecp_PaymentMethod
function create_ecp_PaymentMethod()
{
$uniqueValue = get_unique_value();
$merchantAccountId = 'account-' . $uniqueValue;
$merchantPaymentMethodId = 'pm-' . $uniqueValue;
$email = get_unique_value() . '@nomail.com';
$successUrl = 'http://good.com/';
//need a trailing slash
$errorUrl = 'http://bad.com/';
//need a trailing slash
$name = 'John Vindicia';
$addr1 = '303 Twin Dolphin Drive';
$city = 'Redwood City';
$district = 'CA';
$postalCode = '94065';
$country = 'US';
$address = new Address();
$address->setName($name);
$address->setAddr1($addr1);
$address->setCity($city);
$address->setDistrict($district);
$address->setPostalCode($postalCode);
$address->setCountry($country);
$paymentmethod = new PaymentMethod();
$paymentmethod->setType('ECP');
$paymentmethod->setAccountHolderName($name);
$paymentmethod->setBillingAddress($address);
$paymentmethod->setMerchantPaymentMethodId($merchantPaymentMethodId);
$paymentmethod->setCurrency('USD');
$ecp = new ECP();
$ecp->setAccount('495958930');
$ecp->setRoutingNumber('611111111');
$ecp->setAllowedTransactionType('Inbound');
$ecp->setAccountType('ConsumerChecking');
$paymentmethod->setECP($ecp);
$account = new Account();
$account->setMerchantAccountId($merchantAccountId);
$account->setEmailAddress($email);
$account->setShippingAddress($address);
$account->setEmailTypePreference('html');
$account->setName($name);
$account->setPaymentMethods(array($paymentmethod));
return $account;
}
示例5: retrieveByClient
static public function retrieveByClient($client_id = null)
{
if(!$client_id)
die('Should add case for all clients!');
// sql here for retrieve info from db by $client_id
$accounts = array();
$query="SELECT a.id, a.name, a.amount, c.abbreviation cname FROM account a, currency c WHERE id_client = '$client_id' AND c.id = a.id_currency";
//echo $query;
$qres=mysql_query($query);
while($row=mysql_fetch_assoc($qres))
{
$account = new Account();
$account->setId($row['id']);
$account->setName($row['name']);
$account->setAmount($row['amount']);
$account->setCurrency($row['cname']);
$accounts[] = $account;
}
return $accounts;
}
示例6: __construct
public function __construct($arrayAccounts)
{
// browse through list
$collection = array();
if ($arrayAccounts) {
foreach ($arrayAccounts as $arrayAccount) {
$account = new Account();
$account->setId($arrayAccount['name_value_list']['id']);
$account->setName(htmlspecialchars_decode($arrayAccount['name_value_list']['name'], ENT_QUOTES));
$account->setAssignedAt($arrayAccount['name_value_list']['assigned_user_name']);
$account->setidLMB($arrayAccount['name_value_list']['id_compte_lundi_matin_c']);
$collection[$account->getId()] = $account;
}
// Sort accounts by name
usort($collection, function ($a, $b) {
return strcmp($a->getName(), $b->getName());
});
}
// build ArrayObject using collection
return parent::__construct($collection);
}
示例7: 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);
}
}
示例8: create_paypal_PaymentMethod
function create_paypal_PaymentMethod()
{
$uniqueValue = get_unique_value();
$merchantAccountId = 'account-' . $uniqueValue;
$merchantPaymentMethodId = 'pm-' . $uniqueValue;
$email = get_unique_value() . '@nomail.com';
$successUrl = 'http://good.com/';
//need a trailing slash
$errorUrl = 'http://bad.com/';
//need a trailing slash
$name = 'John Vindicia';
$addr1 = '303 Twin Dolphin Drive';
$city = 'Redwood City';
$district = 'CA';
$postalCode = '94065';
$country = 'US';
$address = new Address();
$address->setName($name);
$address->setAddr1($addr1);
$address->setCity($city);
$address->setDistrict($district);
$address->setPostalCode($postalCode);
$address->setCountry($country);
$paymentmethod = new PaymentMethod();
$paymentmethod->setType('PayPal');
$paymentmethod->setAccountHolderName($name);
$paymentmethod->setBillingAddress($address);
$paymentmethod->setMerchantPaymentMethodId($merchantPaymentMethodId);
$paymentmethod->setCurrency('USD');
$paypal = new PayPal();
$paypal->setReturnUrl($successUrl);
$paypal->setCancelUrl($errorUrl);
$paymentmethod->setPaypal($paypal);
$account = new Account();
$account->setMerchantAccountId($merchantAccountId);
$account->setEmailAddress($email);
$account->setShippingAddress($address);
$account->setEmailTypePreference('html');
$account->setName($name);
//$account->setPaymentMethods(array($paymentmethod));
//return $account;
return array('account' => $account, 'paymentmethod' => $paymentmethod);
}
示例9: strlen
<tr><td>Name:</td><td> <input size=20 type=text name=name value=".$_POST['name']."><br></td></tr>
<tr><td>Surname:</td><td> <input size=20 type=text name=surname value=".$_POST['surname']."><br></td></tr>
<tr><td>Phone Number:</td><td> <input type=text name=number value=".$_POST['number']."><br></td></tr>
<tr><td>Region:</td><td> <input type=text name=region value=".$_POST['region']."><br></td></tr>
<tr><td></td><td><input type=submit value='Register'></td></tr>
</form>
</table>
</font>
";
}elseif( $_POST['password'] == $_POST['repassword'] && strlen($_POST['password'])>0 )
{
//account creation
$account = new Account();
$account->setEmail($_POST['email']);
$account->setPassword($_POST['password']);
$account->setName($_POST['name']);
$account->setSurname($_POST['surname']);
$account->setNumber($_POST['number']);
//$account->showVariable(); //this is for debugger
//echo $_POST['email'];
$account->checkemail($_POST['email']);
$account->addAccount( $account->checkemailflag,$_POST['email'],$_POST['password'],$_POST['name'],$_POST['surname'],$_POST['number'],$_POST['region'] );
//password didn't match
}else{
echo " <font size=4>Your account has not been created. Please fill out the form correctly.</font><br>";
}
}else{
?>
<center><h2>SIGN UP</h2></center>
<font size=4>
示例10: trim
include_once './system/load.compat.php';
$newpass = trim($_POST['newpass']);
if (!check_password($newpass)) {
echo 'Password contains illegal characters. Please use only a-Z and 0-9. <a href="install.php?page=step&step=5">GO BACK</a> and write other password.';
} else {
//create / set pass to admin account
$account = new Account(1, Account::LOADTYPE_NAME);
if ($account->isLoaded()) {
$account->setPassword($newpass);
// setPassword encrypt it to ots encryption
$account->setPageAccess(3);
$account->setFlag('unknown');
$account->save();
} else {
$newAccount = new Account();
$newAccount->setName(1);
$newAccount->setPassword($newpass);
// setPassword encrypt it to ots encryption
$newAccount->setMail(rand(0, 999999) . '@gmail.com');
$newAccount->setPageAccess(3);
$newAccount->setGroupID(1);
$newAccount->setFlag('unknown');
$newAccount->setCreateIP(Visitor::getIP());
$newAccount->setCreateDate(time());
}
$_SESSION['account'] = 1;
$_SESSION['password'] = $newpass;
$logged = TRUE;
echo '<h1>Admin account login: 1<br>Admin account password: ' . $newpass . '</h1><br/><h3>It\'s end of installation. Installation is blocked!</h3>';
if (!unlink('install.txt')) {
new Error_Critic('', 'Cannot remove file <i>install.txt</i>. You must remove it to disable installer. I recommend you to go to step <i>0</i> and check if any other file got problems with WRITE permission.');
示例11: rand
$state = "CA";
$postalcode = "94002";
$country = "US";
$email = "childAccount" . rand(10000, 99999) . "@vindicia.com";
$address = new Address();
$address->setName($name);
$address->setAddr1($addr1);
$address->setCity($city);
$address->setDistrict($state);
$address->setPostalCode($postalcode);
$address->setCountry($country);
$accountID = "childAccount" . rand(1000, 9999) . "-" . rand(1000, 999999);
$child1 = new Account();
$child1->setMerchantAccountId($accountID);
$child1->setEmailAddress($email);
$child1->setShippingAddress($address);
$child1->setEmailTypePreference('html');
$child1->setWarnBeforeAutoBilling(false);
$child1->setName($name);
$parent = new Account();
$parent->setMerchantAccountId($parentID);
// use the force flag to remove these children from a previous parent
// and assign them to this new one
//$force=true;
$force = false;
// use payerReplace to determine if any existing autobills of these children
// should use the parents payment method, or only autobills created from here in should.
//$payerReplacementBehavior='ReplaceOnAllAutoBills';
$payerReplacementBehavior = 'ReplaceOnlyFutureAutoBills';
$response = $parent->addChildren(array($child1), $force, $payerReplacementBehavior);
print_r($response);
示例12: Account
if ($account_db->isLoaded()) {
$reg_form_errors[] = 'Account with this name already exist.';
}
}
// ----------creates account-------------(save in database)
if (empty($reg_form_errors)) {
//create object 'account' and generate new acc. number
if ($config['site']['create_account_verify_mail']) {
$reg_password = '';
for ($i = 1; $i <= 6; $i++) {
$reg_password .= mt_rand(0, 9);
}
}
$reg_account = new Account();
// saves account information in database
$reg_account->setName($reg_name);
$reg_account->setPassword($reg_password);
$reg_account->setEMail($reg_email);
$reg_account->setCreateDate(time());
$reg_account->setCreateIP(Visitor::getIP());
$reg_account->setFlag(Website::getCountryCode(long2ip(Visitor::getIP())));
if (isset($config['site']['newaccount_premdays']) && $config['site']['newaccount_premdays'] > 0) {
$reg_account->set("premdays", $config['site']['newaccount_premdays']);
$reg_account->set("lastday", time());
}
$reg_account->save();
//show information about registration
if ($config['site']['send_emails'] && $config['site']['create_account_verify_mail']) {
$mailBody = '<html>
<body>
<h3>Your account name and password!</h3>
示例13: import
public static function import($strXml, $blnOverwrite = false, $blnKeepSettings = false)
{
global $objLiveAdmin, $intDefaultLanguage, $_CONF;
$objReturn = NULL;
$objSettings = NULL;
$blnZip = false;
//*** Init DOM object.
$objDoc = new DOMDocument("1.0", "UTF-8");
$objDoc->formatOutput = false;
$objDoc->preserveWhiteSpace = true;
if (is_file($strXml)) {
$objZip = new dUnzip2($strXml);
if (is_object($objZip)) {
//*** Zip file.
$strXml = $objZip->unzip('data.xml');
if ($strXml !== false) {
//*** Fix a unicode bug. Replace forbidden characters (The first 8).
for ($intCount = 1; $intCount < 9; $intCount++) {
$strHex = str_pad(dechex($intCount), 4, "0", STR_PAD_LEFT);
$strXml = preg_replace('/\\x{' . $strHex . '}/u', "", $strXml);
}
$strXml = preg_replace('/\\x{001f}/u', "", $strXml);
$objDoc->loadXML($strXml);
$blnZip = true;
}
} else {
//*** XML file.
$objDoc->load($strXml);
}
} else {
$objDoc->loadXML($strXml);
}
//*** Build data structure.
foreach ($objDoc->childNodes as $rootNode) {
if ($rootNode->nodeName == "Punch") {
//*** Valid Punch XML.
foreach ($rootNode->childNodes as $accountNode) {
if ($accountNode->nodeName == "account") {
//*** Account node.
if ($blnOverwrite) {
$objAccount = Account::getByPunchId($accountNode->getAttribute("punchId"));
if (is_object($objAccount) && $blnKeepSettings) {
//*** Save settings.
$objSettings = Settings::getByAccount($objAccount->getId());
}
//*** Remove account.
if (is_object($objAccount)) {
$objAccount->delete();
}
}
//*** Create account.
$objAccount = new Account();
$objAccount->setPunchId($accountNode->getAttribute("punchId"));
$objAccount->setName($accountNode->getAttribute("name"));
$objAccount->setUri($accountNode->getAttribute("uri"));
$objAccount->setTimeZoneId(42);
$objAccount->save();
//*** Create temporary account object.
$_CONF['app']['account'] = $objAccount;
foreach ($accountNode->childNodes as $childNode) {
$arrUserIds = array();
$arrGroupIds = array();
switch ($childNode->nodeName) {
case "acl":
self::importAcl($childNode, $objAccount->getId(), $arrUserIds, $arrGroupIds);
break;
case "products":
//*** Add products to the account.
foreach ($childNode->childNodes as $productNode) {
switch ($productNode->nodeName) {
case "pcms":
//*** Add PunchCMS product to the account.
$objAccountProduct = new AccountProduct();
$objAccountProduct->setAccountId($objAccount->getId());
$objAccountProduct->setProductId(PRODUCT_PCMS);
$objAccountProduct->setExpires($productNode->getAttribute("expires"));
$objAccountProduct->save();
$arrStorageIds[0] = 0;
$arrFeedIds[0] = 0;
//*** Add PunchCMS data to the account.
foreach ($productNode->childNodes as $pcmsNode) {
switch ($pcmsNode->nodeName) {
case "settings":
//*** Add settings to the account.
if ($blnKeepSettings && is_object($objSettings)) {
foreach ($objSettings as $objSetting) {
$objSetting->setId(0);
$objSetting->setAccountId($objAccount->getId());
$objSetting->save();
}
} else {
foreach ($pcmsNode->childNodes as $settingNode) {
$objSettingTemplate = SettingTemplate::selectByName($settingNode->getAttribute("name"));
if (is_object($objSettingTemplate)) {
$objSetting = new Setting();
$objSetting->setAccountId($objAccount->getId());
$objSetting->setSettingId($objSettingTemplate->getId());
$objSetting->setValue($settingNode->getAttribute("value"));
$objSetting->save();
}
//.........这里部分代码省略.........
示例14: rand
$address->setDistrict($state);
$address->setPostalCode($postalcode);
$address->setCountry($country);
$accountID = "map-" . rand(1000, 9999) . "-" . rand(1000, 999999);
$map = new MerchantAcceptedPayment();
$pm = new PaymentMethod();
$pm->setType('MerchantAcceptedPayment');
$pm->setMerchantAcceptedPayment($map);
$pm_array = array($pm);
$account = new Account();
$account->setMerchantAccountId($accountID);
$account->setEmailAddress($email);
$account->setShippingAddress($address);
$account->setEmailTypePreference('html');
$account->setWarnBeforeAutoBilling(false);
$account->setName($name);
$account->setPaymentMethods($pm_array);
// must be an existing Product
$productID = $argv[1];
print "productID is {$productID} \n";
$product = new Product();
$product->setMerchantProductId($productID);
// AutoBills may have multiple products
// each in an AutoBillItem as an array:
$item = new AutoBillItem();
// set the Product in the AutoBillItem
$item->setProduct($product);
$item->setMerchantAutoBillItemId('myAutoBillItem-' . rand(00, 99999));
// must be an existing BillingPlan
$billingplanID = $argv[2];
print "billingplanID is {$billingplanID} \n";
示例15: parseAccount
function parseAccount($eId, $cmd)
{
global $_PATHS, $_CONF, $objUpload, $objLiveAdmin;
$objTpl = new HTML_Template_IT($_PATHS['templates']);
$objTpl->loadTemplatefile("account.tpl.htm");
switch ($cmd) {
case CMD_EDIT:
$strDispatch = Request::get('dispatch');
$intPermId = Request::get('frm_userid');
$strPunchId = Request::get('frm_punchid');
$strName = Request::get('frm_name');
$strDomain = Request::get('frm_uri');
$strUserName = Request::get('frm_account_name');
$strUserPass = Request::get('frm_account_pass');
$strUserEmail = Request::get('frm_account_email');
//$arrProducts = Request::get('frm_account_product', array());
$objAccount = Account::selectByPk($eId);
if ($strDispatch == "editAccount") {
if (is_object($objAccount)) {
$objAccount->setName($strName);
$objAccount->setUri($strDomain);
$objAccount->save();
//*** Set products.
$objAccount->clearProducts();
/*
foreach ($arrProducts as $intProduct) {
$objAccount->addProduct($intProduct);
}
*/
$objAccount->addProduct(1);
//*** Edit Admin user.
$data = array('name' => $strUserName, 'email' => $strUserEmail);
if (!empty($strUserPass)) {
$data['passwd'] = $strUserPass;
}
$objLiveAdmin->updateUser($data, $intPermId);
$objTpl->setCurrentBlock("text");
$objTpl->setVariable('BODY', "<p>Account saved successfully.</p>");
$objTpl->parseCurrentBlock();
}
} else {
if (is_object($objAccount)) {
$strAdminName = "";
$strAdminEmail = "";
//*** Admin user.
$filters = array('container' => 'auth', 'filters' => array('account_id' => array($objAccount->getId())));
$objUsers = $objLiveAdmin->getUsers($filters);
if (is_array($objUsers)) {
foreach ($objUsers as $objUser) {
if ($objUser["perm_type"] == 4) {
$strAdminName = $objUser["name"];
$strAdminEmail = $objUser["email"];
$intPermId = $objUser["perm_user_id"];
break;
}
}
}
$objTpl->setCurrentBlock("form.field.punchid");
$objTpl->setVariable('PUNCH_ID_VALUE', $objAccount->getPunchId());
$objTpl->parseCurrentBlock();
/*
$objProducts = Product::getProducts();
$objAccountProducts = AccountProduct::getByAccountId($objAccount->getId());
foreach ($objProducts as $objProduct) {
$objTpl->setCurrentBlock("form.field.product");
$objTpl->setVariable('ID', $objProduct->getId());
$objTpl->setVariable('LABEL', $objProduct->getName());
$objTpl->setVariable('VALUE', $objProduct->getId());
foreach ($objAccountProducts as $objAccountProduct) {
if ($objAccountProduct->getProductId() == $objProduct->getId()) {
$objTpl->setVariable('CHECKED', "checked=\"checked\"");
}
}
$objTpl->parseCurrentBlock();
}
*/
$objTpl->setCurrentBlock("form.edit");
$objTpl->setVariable('NAME_VALUE', $objAccount->getName());
$objTpl->setVariable('URI_VALUE', $objAccount->getUri());
$objTpl->setVariable('ACCOUNT_NAME_VALUE', $strAdminName);
$objTpl->setVariable('ACCOUNT_EMAIL_VALUE', $strAdminEmail);
$objTpl->setVariable('USER_ID', $intPermId);
$objTpl->setVariable('CID', NAV_ACCOUNT);
$objTpl->setVariable('EID', $eId);
$objTpl->setVariable('CMD', $cmd);
$objTpl->parseCurrentBlock();
}
}
break;
case CMD_ADD:
$strDispatch = Request::get('dispatch');
$strName = Request::get('frm_name');
$strDomain = Request::get('frm_uri');
$strUserName = Request::get('frm_account_name');
$strUserPass = Request::get('frm_account_pass');
$strUserEmail = Request::get('frm_account_email');
//$arrProducts = Request::get('frm_account_product');
if ($strDispatch == "editAccount") {
//.........这里部分代码省略.........