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


PHP Account::first方法代码示例

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


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

示例1: profile

 /**
  * @before _secure, _vendor, _admin
  */
 public function profile()
 {
     $this->seo(array("title" => "Vendor Profile", "view" => $this->getLayoutView()));
     $view = $this->getActionView();
     $action = RequestMethods::post("action", "");
     $account = Account::first(array("organization_id = ?" => $this->member->organization_id));
     $org = $this->organization;
     switch ($action) {
         case 'tin':
             $org->tin = RequestMethods::post("tin");
             $org->tin_file = $this->_upload("tin_file");
             $org->save();
             $view->set("message", "Saved Successfully");
             break;
         case 'pan':
             $org->pan = RequestMethods::post("pan");
             $org->pan_file = $this->_upload("pan_file");
             $org->save();
             $view->set("message", "Saved Successfully");
             break;
         case 'lac':
             $org->lac = $this->_upload("lac");
             $org->save();
             $view->set("message", "Saved Successfully");
             break;
         case 'termandcon':
             $org->terms = $this->_upload("terms");
             $org->save();
             $view->set("message", "Saved Successfully");
             break;
         case 'authcerti':
             $org->terms = $this->_upload("certi");
             $org->save();
             $view->set("message", "Saved Successfully");
             break;
         case 'user':
             $user = User::first(array("id = ?" => $this->user->id));
             $user->name = RequestMethods::post("name");
             $user->phone = RequestMethods::post("phone");
             $user->save();
             $view->set("user", $user);
             $view->set("message", "Saved Successfully");
             break;
         case 'account':
             if (!$account) {
                 $account = new Account(array("user_id" => $this->user->id, "organization_id" => $this->organization->id, "name" => RequestMethods::post("name"), "bank" => RequestMethods::post("bank"), "number" => RequestMethods::post("number"), "ifsc" => RequestMethods::post("ifsc", ""), "instamojo" => RequestMethods::post("instamojo", "")));
                 $account->save();
                 $view->set("message", "Saved Successfully");
             }
             break;
     }
     $view->set("account", $account);
 }
开发者ID:HLitmus,项目名称:WebApp,代码行数:56,代码来源:vendor.php

示例2: testCantUpdatePKAttributes

 /**
  * Test can't update primary key
  *
  * @return null
  */
 public function testCantUpdatePKAttributes()
 {
     $account = TORM\Factory::create("account");
     $this->assertTrue($account->save());
     $account = Account::first();
     $old_id = $account->id;
     $new_id = 999;
     $new_num = "54321";
     $this->assertTrue($account->updateAttributes(array("id" => $new_id, "number" => $new_num)));
     $account = Account::find($old_id);
     $this->assertNotNull($account);
     $this->assertEquals($new_num, $account->number);
     $this->assertNull(Account::find($new_id));
 }
开发者ID:hugoabonizio,项目名称:torm,代码行数:19,代码来源:modelTest.php

示例3: fromCredentials

 public static function fromCredentials($user, $passHash)
 {
     return Account::first('username=' . safeSQLString($user) . ' AND password=' . safeSQLString($passHash));
 }
开发者ID:RHY3756547,项目名称:FreeSO,代码行数:4,代码来源:model.php

示例4: testHasOneRelation

 public function testHasOneRelation()
 {
     $this->assertEquals(Account::first(), User::first()->account());
 }
开发者ID:gigorok,项目名称:php-orm,代码行数:4,代码来源:ModelTest.php

示例5: testAccountCreateCredit

 /**
  * Tests that credit account may be created.
  *
  * @return void
  */
 public function testAccountCreateCredit()
 {
     $params = array('customer_id' => $this->user->id, 'balance' => 1000.32, 'type' => 'credit');
     $response = $this->call('POST', '/account', $params);
     $account = Account::first();
     $this->cleanUp();
     $this->assertResponseStatus('201');
     $this->assertEquals('credit', $account->type->name);
 }
开发者ID:yeyande,项目名称:CS499,代码行数:14,代码来源:AccountTest.php

示例6: GetByName

 public static function GetByName($accountName, $activatedOnly = false)
 {
     $account = Account::first(array('account_name' => $accountName, 'IsApproved' => $activatedOnly));
     return $account;
 }
开发者ID:krasaler,项目名称:FamilyStore,代码行数:5,代码来源:AccountService.php

示例7: testHasOneRelation

 /**
  * Test has one relation
  *
  * @return null
  */
 public function testHasOneRelation()
 {
     $account = Account::first();
     $user = User::first();
     $acct = $user->account;
     $this->assertNotNull($acct);
     $this->assertEquals("Account", get_class($acct));
     $this->assertEquals($account->account_number, $acct->account_number);
 }
开发者ID:taq,项目名称:torm,代码行数:14,代码来源:modelTest.php


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