当前位置: 首页>>代码示例>>PHP>>正文


PHP Application_Model_Option::save方法代码示例

本文整理汇总了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();
     }
 }
开发者ID:Rademade,项目名称:MedOptima,代码行数:17,代码来源:OptionController.php

示例2: save

 public function save()
 {
     if (!$this->getId()) {
         $this->setNextPosition();
         $this->setLayoutId(1)->setIsActive(1);
     }
     return parent::save();
 }
开发者ID:bklein01,项目名称:siberian_cms_2,代码行数:8,代码来源:Value.php

示例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();
    }
}
开发者ID:bklein01,项目名称:siberian_cms_2,代码行数:16,代码来源:database.3.8.2.php


注:本文中的Application_Model_Option::save方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。