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


PHP Gadget::save方法代碼示例

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


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

示例1: up

 public function up()
 {
     $gadget = new Gadget();
     $gadget->setType('loginTop');
     $gadget->setName('loginForm');
     $gadget->setSortOrder(10);
     $gadget->save();
 }
開發者ID:te-koyama,項目名稱:openpne,代碼行數:8,代碼來源:002_insert_login_gadget.php

示例2: up

 public function up()
 {
     $criteria = new Criteria();
     $criteria->add(GadgetPeer::TYPE, 'mobileLoginContents');
     $criteria->add(GadgetPeer::NAME, 'loginForm');
     if (!GadgetPeer::doSelectOne($criteria)) {
         $gadget = new Gadget();
         $gadget->setType('mobileLoginContents');
         $gadget->setName('loginForm');
         $gadget->setSortOrder(10);
         $gadget->save();
     }
 }
開發者ID:te-koyama,項目名稱:openpne,代碼行數:13,代碼來源:006_add_mobile_login_gadget.php

示例3: save

 public function save()
 {
     foreach ($this->values as $type => $gadgets) {
         if (!$gadgets) {
             continue;
         }
         foreach ($gadgets as $value) {
             $gadget = new Gadget();
             $gadget->setType($type);
             $gadget->setName($value);
             $gadget->save();
         }
     }
 }
開發者ID:te-koyama,項目名稱:openpne,代碼行數:14,代碼來源:GadgetAddForm.class.php

示例4: up

 public function up()
 {
     $eventNavigation = new Navigation();
     $eventNavigation->setType('community');
     $eventNavigation->setUri('communityEvent/listCommunity');
     $eventNavigation->setSortOrder(6);
     $eventNavigation->setCaption('Events', 'en');
     $eventNavigation->setCaption('イベントリスト', 'ja_JP');
     $gadget = new Gadget();
     $gadget->setType('contents');
     $gadget->setName('recentCommunityEventComment');
     $gadget->setSortOrder(132);
     $gadget->save();
     $gadget = new Gadget();
     $gadget->setType('mobileContents');
     $gadget->setName('recentCommunityEventComment');
     $gadget->setSortOrder(111);
     $gadget->save();
 }
開發者ID:te-koyama,項目名稱:openpne,代碼行數:19,代碼來源:004_update_op_community_topic_plugin_0_8_1_4.php

示例5: up

 public function up()
 {
     $gadget = new Gadget();
     $gadget->setType('top');
     $gadget->setName('birthdayBox');
     $gadget->setSortOrder(0);
     $gadget->save();
     $gadget = new Gadget();
     $gadget->setType('mobileTop');
     $gadget->setName('birthdayBox');
     $gadget->setSortOrder(0);
     $gadget->save();
     $gadget = new Gadget();
     $gadget->setType('profileTop');
     $gadget->setName('birthdayBox');
     $gadget->setSortOrder(0);
     $gadget->save();
     $gadget = new Gadget();
     $gadget->setType('mobileProfileTop');
     $gadget->setName('birthdayBox');
     $gadget->setSortOrder(0);
     $gadget->save();
 }
開發者ID:te-koyama,項目名稱:openpne,代碼行數:23,代碼來源:045_insert_birthday_gadget.php

示例6: dirname

<?php

include_once dirname(__FILE__) . '/../../../bootstrap/unit.php';
include_once dirname(__FILE__) . '/../../../bootstrap/database.php';
sfContext::createInstance($configuration);
$t = new lime_test(12, new lime_output_color());
$gadget1 = Doctrine::getTable('Gadget')->findOneByName('languageSelecterBox');
$gadget3 = Doctrine::getTable('Gadget')->find(3);
$newGadget1 = new Gadget();
$newGadget2 = new Gadget();
$newGadget2->setType('top');
//------------------------------------------------------------
$t->diag('Gadget');
$t->diag('Gadet::preSave()');
$newGadget2->save();
$t->is($newGadget2->getSortOrder(), 20);
//------------------------------------------------------------
$t->diag('Gadet::getComponentModule()');
$t->is($gadget1->getComponentModule(), 'default');
$t->ok(!$newGadget1->getComponentModule());
//------------------------------------------------------------
$t->diag('Gadet::getComponentAction()');
$t->is($gadget1->getComponentAction(), 'languageSelecterBox');
$t->ok(!$newGadget1->getComponentAction());
//------------------------------------------------------------
$t->diag('Gadet::isEnabled()');
$t->ok($gadget1->isEnabled());
$t->ok(!$newGadget1->isEnabled());
//------------------------------------------------------------
$t->diag('Gadet::getConfig()');
$t->is($gadget3->getConfig('row'), 1);
開發者ID:te-koyama,項目名稱:openpne,代碼行數:31,代碼來源:GadgetTest.php


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