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


PHP Db::forPrefixTable方法代碼示例

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


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

示例1: testUninstall

 /**
  * testUninstall
  *
  * @since 2.2.0
  */
 public function testUninstall()
 {
     /* setup */
     $module = new Module(array('alias' => 'test'));
     $module->uninstall();
     /* result */
     Db::clearCache();
     $result = Db::forPrefixTable('modules')->where('alias', 'test')->findOne();
     /* compare */
     $this->assertFalse(is_object($result));
 }
開發者ID:ITw3,項目名稱:redaxscript,代碼行數:16,代碼來源:ModuleTest.php

示例2: tearDownAfterClass

 /**
  * tearDownAfterClass
  *
  * @since 2.2.0
  */
 public static function tearDownAfterClass()
 {
     Db::forPrefixTable('categories')->where('alias', 'ultra')->deleteMany();
     Db::forPrefixTable('categories')->where('alias', 'lightweight')->deleteMany();
     Db::forPrefixTable('articles')->where('alias', 'cms')->deleteMany();
 }
開發者ID:ITw3,項目名稱:redaxscript,代碼行數:11,代碼來源:BreadcrumbTest.php

示例3: _buildContent

 /**
  * build the breadcrumb array for current content
  *
  * @since 2.1.0
  *
  * @param integer $key
  */
 private function _buildContent($key = 0)
 {
     /* join first title */
     $this->_breadcrumbArray[$key]['title'] = Db::forPrefixTable($this->_registry->get('firstTable'))->where('alias', $this->_registry->get('firstParameter'))->findOne()->title;
     /* set route if not end */
     if ($this->_registry->get('firstParameter') !== $this->_registry->get('lastParameter')) {
         $this->_breadcrumbArray[$key]['route'] = $this->_registry->get('firstParameter');
     }
     /* join second title */
     if ($this->_registry->get('secondTable')) {
         $key++;
         $this->_breadcrumbArray[$key]['title'] = Db::forPrefixTable($this->_registry->get('secondTable'))->where('alias', $this->_registry->get('secondParameter'))->findOne()->title;
         /* set route if not end */
         if ($this->_registry->get('secondParameter') !== $this->_registry->get('lastParameter')) {
             $this->_breadcrumbArray[$key]['route'] = $this->_registry->get('firstParameter') . '/' . $this->_registry->get('secondParameter');
         }
         /* join third title */
         if ($this->_registry->get('thirdTable')) {
             $key++;
             $this->_breadcrumbArray[$key]['title'] = Db::forPrefixTable($this->_registry->get('thirdTable'))->where('alias', $this->_registry->get('thirdParameter'))->findOne()->title;
         }
     }
 }
開發者ID:ITw3,項目名稱:redaxscript,代碼行數:30,代碼來源:Breadcrumb.php

示例4: testMinus

 /**
  * testMinus
  *
  * @since 2.2.0
  */
 public function testMinus()
 {
     /* setup */
     Db::forPrefixTable('settings')->where('name', 'captcha')->findOne()->set('value', 3)->save();
     /* result */
     $result = new Captcha($this->_language);
     /* compare */
     $this->assertTrue(is_object($result));
 }
開發者ID:ITw3,項目名稱:redaxscript,代碼行數:14,代碼來源:CaptchaTest.php

示例5: init

 /**
  * init the class
  *
  * @since 2.1.0
  */
 public function init()
 {
     $this->_detect(array('query' => Request::getQuery('t'), 'session' => Request::getSession($this->_registry->get('root') . '/template'), 'contents' => $this->_registry->get('lastTable') ? Db::forPrefixTable($this->_registry->get('lastTable'))->where('id', $this->_registry->get('lastId'))->findOne()->template : null, 'settings' => Db::getSettings('template'), 'fallback' => 'default'), 'template', 'templates/{value}/index.phtml');
 }
開發者ID:ITw3,項目名稱:redaxscript,代碼行數:9,代碼來源:Template.php

示例6: init

 /**
  * init the class
  *
  * @since 2.1.0
  */
 public function init()
 {
     $this->_detect(array('query' => Request::getQuery('l'), 'session' => Request::getSession($this->_registry->get('root') . '/language'), 'contents' => $this->_registry->get('lastTable') ? Db::forPrefixTable($this->_registry->get('lastTable'))->where('id', $this->_registry->get('lastId'))->findOne()->language : null, 'settings' => Db::getSettings('language'), 'browser' => substr(Request::getServer('HTTP_ACCEPT_LANGUAGE'), 0, 2), 'fallback' => 'en'), 'language', 'languages/{value}.json');
 }
開發者ID:ITw3,項目名稱:redaxscript,代碼行數:9,代碼來源:Language.php


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