本文整理汇总了PHP中Gadget::setType方法的典型用法代码示例。如果您正苦于以下问题:PHP Gadget::setType方法的具体用法?PHP Gadget::setType怎么用?PHP Gadget::setType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gadget
的用法示例。
在下文中一共展示了Gadget::setType方法的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);