当前位置: 首页>>代码示例>>PHP>>正文


PHP Account::create方法代码示例

本文整理汇总了PHP中Account::create方法的典型用法代码示例。如果您正苦于以下问题:PHP Account::create方法的具体用法?PHP Account::create怎么用?PHP Account::create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Account的用法示例。


在下文中一共展示了Account::create方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testUpdateAdditionalOwners

 public function testUpdateAdditionalOwners()
 {
     $response = $this->managedAccountResponse('acct_ABC');
     $this->mockRequest('POST', '/v1/accounts', array('managed' => 'true'), $response);
     $response['legal_entity']['additional_owners'] = array(array('first_name' => 'Bob', 'last_name' => null, 'address' => array('line1' => null, 'line2' => null, 'city' => null, 'state' => null, 'postal_code' => null, 'country' => null), 'verification' => array('status' => 'unverified', 'document' => null, 'details' => null)));
     $this->mockRequest('POST', '/v1/accounts/acct_ABC', array('legal_entity' => array('additional_owners' => array(array('first_name' => 'Bob')))), $response);
     $response['legal_entity']['additional_owners'][0]['last_name'] = 'Smith';
     $this->mockRequest('POST', '/v1/accounts/acct_ABC', array('legal_entity' => array('additional_owners' => array(array('last_name' => 'Smith')))), $response);
     $response['legal_entity']['additional_owners'][0]['last_name'] = 'Johnson';
     $this->mockRequest('POST', '/v1/accounts/acct_ABC', array('legal_entity' => array('additional_owners' => array(array('last_name' => 'Johnson')))), $response);
     $response['legal_entity']['additional_owners'][0]['verification']['document'] = 'file_123';
     $this->mockRequest('POST', '/v1/accounts/acct_ABC', array('legal_entity' => array('additional_owners' => array(array('verification' => array('document' => 'file_123'))))), $response);
     $response['legal_entity']['additional_owners'][1] = array('first_name' => 'Jane', 'last_name' => 'Doe');
     $this->mockRequest('POST', '/v1/accounts/acct_ABC', array('legal_entity' => array('additional_owners' => array(1 => array('first_name' => 'Jane')))), $response);
     $account = Account::create(array('managed' => true));
     $account->legal_entity->additional_owners = array(array('first_name' => 'Bob'));
     $account->save();
     $this->assertSame(1, count($account->legal_entity->additional_owners));
     $this->assertSame('Bob', $account->legal_entity->additional_owners[0]->first_name);
     $account->legal_entity->additional_owners[0]->last_name = 'Smith';
     $account->save();
     $this->assertSame(1, count($account->legal_entity->additional_owners));
     $this->assertSame('Smith', $account->legal_entity->additional_owners[0]->last_name);
     $account['legal_entity']['additional_owners'][0]['last_name'] = 'Johnson';
     $account->save();
     $this->assertSame(1, count($account->legal_entity->additional_owners));
     $this->assertSame('Johnson', $account->legal_entity->additional_owners[0]->last_name);
     $account->legal_entity->additional_owners[0]->verification->document = 'file_123';
     $account->save();
     $this->assertSame('file_123', $account->legal_entity->additional_owners[0]->verification->document);
     $account->legal_entity->additional_owners[1] = array('first_name' => 'Jane');
     $account->save();
     $this->assertSame('Jane', $account->legal_entity->additional_owners[1]->first_name);
 }
开发者ID:xavismeh,项目名称:stripe-php,代码行数:34,代码来源:AccountTest.php

示例2: run

 public function run()
 {
     $faker = Faker::create();
     foreach (range(1, 10) as $index) {
         Account::create([]);
     }
 }
开发者ID:RedTechs,项目名称:sfproject,代码行数:7,代码来源:AccountsTableSeeder.php

示例3: add

 public function add()
 {
     $param = Input::all();
     $emp_id = Employee::where('ssn', '=', $param['ssn'])->pluck('id');
     Account::create(array('username' => $param['username'], 'password' => Hash::make($param['password']), 'employee_id' => $emp_id, 'role_id' => $param['role']));
     return Response::json(array('valid' => TRUE));
 }
开发者ID:radityapradipta,项目名称:Absensi-Binbak,代码行数:7,代码来源:UserController.php

示例4: testCreateAccount

 public function testCreateAccount()
 {
     Client::relateIQ(GlobalVar::KEY, GlobalVar::SECRET);
     $account = new Account(['name' => 'Account4']);
     $res = $account->create();
     $this->assertInstanceOf('Account', $res);
     $this->assertEquals('Account4', $res->name());
 }
开发者ID:vicioux,项目名称:apisdk,代码行数:8,代码来源:accounts_test.php

示例5: run

 public function run()
 {
     $account_fake1 = array('email' => 'administrator@guia-apir.com', 'password' => Hash::make('GuiaApir1234'), 'role_id' => '1', 'activated' => true);
     $account_fake2 = array('email' => 'specialist@guia-apir.com', 'password' => Hash::make('GuiaApir1234'), 'age' => '21', 'referee_number' => '123456789', 'role_id' => '2', 'gender_id' => '1', 'province_id' => '9', 'specialty_id' => '2', 'activated' => true);
     $account_fake3 = array('email' => 'temporal@temporal', 'password' => Hash::make('GuiaApir1234'), 'role_id' => '3', 'activated' => true);
     Account::create($account_fake1);
     Account::create($account_fake2);
     Account::create($account_fake3);
 }
开发者ID:polo070770,项目名称:TFG,代码行数:9,代码来源:AccountSeeder.php

示例6: run

 public function run()
 {
     $faker = $this->getFaker();
     for ($i = 0; $i < 10; $i++) {
         $email = $faker->email;
         $password = Hash::make("password");
         Account::create(["email" => $email, "password" => $password]);
     }
 }
开发者ID:Basvkempen1,项目名称:simpleShop,代码行数:9,代码来源:AccountTableSeeder.php

示例7: store

 /**
  * Store a newly created account in storage.
  *
  * @return Response
  */
 public function store()
 {
     $validator = Validator::make($data = Input::all(), Account::$rules);
     if ($validator->fails()) {
         return Redirect::back()->withErrors($validator)->withInput();
     }
     Account::create($data);
     return Redirect::route('accounts.index');
 }
开发者ID:RedTechs,项目名称:sfproject,代码行数:14,代码来源:AccountsController.php

示例8: post_index

 public function post_index()
 {
     if (!AccountForm::is_valid()) {
         return Redirect::back()->with_input()->with_errors(AccountForm::$validation);
     }
     $new_account = Account::create(Input::get());
     if ($new_account) {
         return Redirect::to_action('accounts');
     }
 }
开发者ID:gigikiri,项目名称:masjid-l3,代码行数:10,代码来源:accounts.php

示例9: stAccount

 public function stAccount()
 {
     $account_id = $this->st_account;
     if (empty($account_id)) {
         $account = Account::create();
         $this->edit('st_account', $account->id);
         return $account;
     }
     return new Account($this->st_account);
 }
开发者ID:name3,项目名称:cheng,代码行数:10,代码来源:Factory.php

示例10: store

 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store()
 {
     $input = Input::all();
     $input['user_id'] = Auth::user()->id;
     $input['account'] = md5(Auth::user()->getFullName() . time());
     $input['token'] = md5($input['account'] . json_encode(Input::all()));
     $validation = Validator::make($input, Account::$rules);
     if ($validation->passes()) {
         Account::create($input);
         return Redirect::route('accounts.index');
     }
     return Redirect::route('accounts.create')->withInput()->withErrors($validation)->with('message', 'There were validation errors.');
 }
开发者ID:aaronbullard,项目名称:litmus,代码行数:18,代码来源:AccountsController.php

示例11: testUpdateAdditionalOwners

 public function testUpdateAdditionalOwners()
 {
     self::authorizeFromEnv();
     $d = Account::create(array('managed' => true));
     $id = $d->id;
     $d->legal_entity->additional_owners = array(array('first_name' => 'Bob'));
     $d->save();
     $d = Account::retrieve($id);
     $this->assertSame(1, count($d->legal_entity->additional_owners));
     $this->assertSame('Bob', $d->legal_entity->additional_owners[0]->first_name);
     $d->legal_entity->additional_owners[0]->last_name = 'Smith';
     $d->save();
     $d = Account::retrieve($id);
     $this->assertSame(1, count($d->legal_entity->additional_owners));
     $this->assertSame('Smith', $d->legal_entity->additional_owners[0]->last_name);
 }
开发者ID:Ezyva2015,项目名称:SMSF-Academy-Wordpress,代码行数:16,代码来源:AccountTest.php

示例12: create

 protected function create(array $params)
 {
     $smarty = SmailSmarty::getInstance();
     $smarty->setTemplate('login.tpl');
     if (!(isset($params['name']) && isset($params['password']) && isset($params['confirm']))) {
         $smarty->assign('CREATE_ERRORS', 1);
     } elseif ($params['password'] != $params['confirm']) {
         $smarty->assign('CREATE_ERRORS', 2);
     } else {
         $account = new Account($params['name'], $params['password']);
         if (!$account->exists()) {
             if ($account->create()) {
                 $_SESSION['account'] = $account->getName();
                 header('Location: ' . WEBDIR . 'Profil');
             }
         } else {
             $smarty->setTemplate('login.tpl');
             $smarty->assign('CREATE_ERRORS', 3);
         }
     }
 }
开发者ID:BackupTheBerlios,项目名称:smail-svn,代码行数:21,代码来源:AccountManager.php

示例13: createAccountsFromAttributes

 private function createAccountsFromAttributes($attributes, $orders=array(), $ordertasks=array(), $purchases=array()){
     $data = \Account::create($attributes);
     if(is_null($data)) return;
     if($this->isordridauto){
         $this->updateLastId($data->type, $data->acnt_no);
     }
     if($data->accounttype === Menu::acc_type_receivables){
         $this->saveAccountOrders($orders, $data->id);
     }else{
         $this->saveAccountOrdertasks($ordertasks, $data->id);
         $this->saveAccountPurchases($purchases, $data->id);
     }
 }
开发者ID:Rajagunasekaran,项目名称:BACKUP,代码行数:13,代码来源:Menu.php

示例14: create_accounts

 /**
  * prepare test accounts
  */
 public static function create_accounts()
 {
     // Create admin account
     // First account is always admin
     if (!Account::exists("testadmin")) {
         if (!Account::create("testadmin", "testadminpassword", "testadminpassword")) {
             throw new Exception("Cannot create admin account");
         }
     }
     // Create normal account
     if (!Account::exists("testuser")) {
         if (!Account::create("testuser", "testpassword", "testpassword")) {
             throw new Exception("Cannot create testuser account");
         }
     }
 }
开发者ID:inscriptionweb,项目名称:PhotoShow,代码行数:19,代码来源:TestUnit.php

示例15: testCreate

 public function testCreate()
 {
     // row to create
     $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('insert')->with('accounts', $values)->will($this->returnValue(true));
     $accountsTable = new Account($adapter);
     // getInstance doesn't work well in testing
     $result = $accountsTable->create($values);
     $this->assertTrue($result);
 }
开发者ID:martynbiz,项目名称:database,代码行数:13,代码来源:TableTest.php


注:本文中的Account::create方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。