本文整理匯總了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();
}
示例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();
}
}
示例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();
}
}
}
示例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();
}
示例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();
}
示例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);