當前位置: 首頁>>代碼示例>>PHP>>正文


PHP DB_DataObject::DebugLevel方法代碼示例

本文整理匯總了PHP中DB_DataObject::DebugLevel方法的典型用法代碼示例。如果您正苦於以下問題:PHP DB_DataObject::DebugLevel方法的具體用法?PHP DB_DataObject::DebugLevel怎麽用?PHP DB_DataObject::DebugLevel使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在DB_DataObject的用法示例。


在下文中一共展示了DB_DataObject::DebugLevel方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testTransactionCommitWithCustomMethodsAcrossMultipleTables

 public function testTransactionCommitWithCustomMethodsAcrossMultipleTables()
 {
     $c = DB_DataObject::factory('vanillainnodb');
     // innoDB
     $c->find();
     $cl = DB_DataObject::factory('vanillainnodb2');
     // innoDB
     $cl->name = 'Michael Jackson';
     $cl->insert();
     $u = DB_DataObject::factory('testuser');
     // Non innoDB
     $u->login = 'test';
     $u->password = 'test';
     $this->assertTrue($u->insert());
     // Just to verify inserting was ok
     $c->begin();
     while ($c->fetch()) {
         $c->delete();
     }
     $u->delete();
     $cl->delete();
     $c->commit();
     DB_DataObject::DebugLevel(0);
     $c2 = DB_DataObject::factory('vanillainnodb');
     $this->assertFalse($c2->find());
     $u2 = DB_DataObject::factory('testuser');
     $u2->login = 'test';
     $u2->password = 'test';
     $this->assertFalse($u2->find());
     // Non innoDB
     $cl = DB_DataObject::factory('vanillainnodb2');
     $cl->name = 'Michael Jackson';
     $this->assertFalse($cl->find());
 }
開發者ID:demental,項目名稱:m,代碼行數:34,代碼來源:DB_DataObject_Pluggable_test.php

示例2: testProcessFormUpdateNoni18nFields

 public function testProcessFormUpdateNoni18nFields()
 {
     $t = DB_DataObject::factory('formtest');
     $t->get(2);
     $fb = MyFB::create($t);
     $form = $fb->getForm();
     $post = array_merge($form->exportValues(), array('pays' => 'es', 'testuser_id' => '5', '_qf__' . $form->getAttribute('name') => 1));
     $get = $_GET;
     $request = array_merge($get, $post);
     $form->initRequest($get, $post, $request);
     $this->assertTrue($form->isSubmitted());
     //    DB_DataObject::DebugLevel(1);
     $form->process(array($fb, 'processForm'), false);
     DB_DataObject::DebugLevel(0);
     T::setLang('fr');
     $t = DB_DataObject::factory('formtest');
     $t->get(2);
     $this->assertEqual($t->pays, 'es');
     $this->assertEqual($t->testuser_id, '5');
 }
開發者ID:demental,項目名稱:m,代碼行數:20,代碼來源:i18n_test.php


注:本文中的DB_DataObject::DebugLevel方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。