本文整理汇总了PHP中Application_Model_Option::save方法的典型用法代码示例。如果您正苦于以下问题:PHP Application_Model_Option::save方法的具体用法?PHP Application_Model_Option::save怎么用?PHP Application_Model_Option::save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Application_Model_Option
的用法示例。
在下文中一共展示了Application_Model_Option::save方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: editAction
public function editAction()
{
parent::editAction();
if ($this->getRequest()->isPost()) {
$data = (object) $this->getRequest()->getPost();
try {
$this->_setData($data);
$this->_entity->save();
$this->__goBack();
} catch (Exception $e) {
$this->view->showMessage($e);
}
} else {
$this->__postContentFields();
$_POST['key'] = $this->_entity->getOptionKey();
}
}
示例2: save
public function save()
{
if (!$this->getId()) {
$this->setNextPosition();
$this->setLayoutId(1)->setIsActive(1);
}
return parent::save();
}
示例3: varchar
<?php
$fields = array_keys($this->_db->describeTable("application_option"));
if (!in_array("mobile_view_uri", $fields)) {
$this->query("\n ALTER TABLE `application_option` ADD `mobile_view_uri` varchar(100) NULL DEFAULT NULL AFTER `mobile_uri`;\n ALTER TABLE `application_option` ADD `mobile_view_uri_parameter` varchar(100) NULL DEFAULT NULL AFTER `mobile_view_uri`;\n ");
}
$mobile_view_uris = array("booking" => array("mobile_view_uri" => "booking/mobile_view/", "mobile_view_uri_parameter" => null), "calendar" => array("mobile_view_uri" => "event/mobile_view/", "mobile_view_uri_parameter" => "event_id"), "catalog" => array("mobile_view_uri" => "catalog/mobile_category_product_view/", "mobile_view_uri_parameter" => "product_id"), "custom_page" => array("mobile_view_uri" => "cms/mobile_page_view/", "mobile_view_uri_parameter" => null), "discount" => array("mobile_view_uri" => "promotion/mobile_view/", "mobile_view_uri_parameter" => "promotion_id"), "fanwall" => array("mobile_view_uri" => "comment/mobile_view/", "mobile_view_uri_parameter" => "comment_id"), "image_gallery" => array("mobile_view_uri" => "media/mobile_gallery_image_view/", "mobile_view_uri_parameter" => "gallery_id,offset/0"), "m_commerce" => array("mobile_view_uri" => "mcommerce/mobile_product/", "mobile_view_uri_parameter" => "product_id"), "music_gallery" => array("mobile_view_uri" => "media/mobile_api_music_playlist/", "mobile_view_uri_parameter" => "playlist_id"), "newswall" => array("mobile_view_uri" => "comment/mobile_view/", "mobile_view_uri_parameter" => "comment_id"), "qr_discount" => array("mobile_view_uri" => "promotion/mobile_view/", "mobile_view_uri_parameter" => "promotion_id"), "rss_feed" => array("mobile_view_uri" => "rss/mobile_feed_view/", "mobile_view_uri_parameter" => "feed_id"), "set_meal" => array("mobile_view_uri" => "catalog/mobile_setmeal_view/", "mobile_view_uri_parameter" => "set_meal_id"), "video_gallery" => array("mobile_view_uri" => "media/mobile_gallery_video_view/", "mobile_view_uri_parameter" => "gallery_id,offset/1"));
foreach ($mobile_view_uris as $option_code => $option_uris) {
$application_option = new Application_Model_Option();
$application_option->find($option_code, "code");
if ($application_option->getId()) {
$application_option->setMobileViewUri($option_uris["mobile_view_uri"]);
$application_option->setMobileViewUriParameter($option_uris["mobile_view_uri_parameter"]);
$application_option->save();
}
}