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


PHP JModelAdmin::save方法代码示例

本文整理汇总了PHP中JModelAdmin::save方法的典型用法代码示例。如果您正苦于以下问题:PHP JModelAdmin::save方法的具体用法?PHP JModelAdmin::save怎么用?PHP JModelAdmin::save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在JModelAdmin的用法示例。


在下文中一共展示了JModelAdmin::save方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: save

 function save($data)
 {
     $oldData = array();
     if ($data['id'] > 0) {
         $table = $this->getTable();
         $table->load($data['id']);
         $oldData['id'] = $table->id;
         $oldData['provider'] = $table->provider;
         $oldData['type'] = $table->type;
         $oldData['attribs'] = (array) $table->attribs;
     }
     // Set the dates
     $date = JFactory::getDate();
     if ($data['id'] == 0) {
         $data['created'] = $date->toSql();
     }
     $data['modified'] = $date->toSql();
     if ($data['provider'] != '--' && $data['type'] != '--') {
         $channel = JFBCFactory::provider($data['provider'])->channel($data['type']);
         $data = $channel->onBeforeSave($data);
         // Manipulate the data however may be necessary
     }
     $return = parent::save($data);
     // Used to removed permissions from users that aren't associated with this channel (or anything else needed for cleanup)
     if ($return && $data['provider'] != '--' && $data['type'] != '--') {
         $data['id'] = $this->getState('channel.id');
         $channel->onAfterSave($data, $oldData);
     }
     return $return;
 }
开发者ID:q0821,项目名称:esportshop,代码行数:30,代码来源:channel.php

示例2: save

 /**
  * The save function
  *
  * @param   array  $list  - data to save
  *
  * @return bool
  */
 public function save($list)
 {
     $user = JFactory::getUser();
     $item = array();
     $item['id'] = null;
     $item['mc_id'] = $list['id'];
     $item['web_id'] = $list['web_id'];
     $item['list_name'] = $list['name'];
     $item['date_created'] = $list['date_created'];
     $item['email_type_option'] = $list['email_type_option'];
     $item['use_awesomebar'] = $list['use_awesomebar'];
     $item['default_from_name'] = $list['default_from_name'];
     $item['default_from_email'] = $list['default_from_email'];
     $item['default_subject'] = $list['default_subject'];
     $item['default_language'] = $list['default_language'];
     $item['list_rating'] = $list['list_rating'];
     $item['subscribe_url_short'] = $list['subscribe_url_short'];
     $item['subscribe_url_long'] = $list['subscribe_url_long'];
     $item['beamer_address'] = $list['beamer_address'];
     $item['visibility'] = $list['visibility'];
     $item['created_user_id'] = $user->id;
     $item['created_time'] = JFactory::getDate()->toSql();
     $item['modified_user_id'] = $user->id;
     $item['modified_time'] = JFactory::getDate()->toSql();
     $item['access'] = 1;
     $item['query_data'] = json_encode($list);
     return parent::save($item);
 }
开发者ID:fracting,项目名称:cmc,代码行数:35,代码来源:list.php

示例3: save

 public function save($data)
 {
     if (!empty($data['payment_type'])) {
         $data['payment_type'] = json_encode($data['payment_type']);
     }
     return parent::save($data);
 }
开发者ID:ngxuanmui,项目名称:hp3,代码行数:7,代码来源:service.php

示例4: save

 function save($data)
 {
     $courses_csv = implode(',', $data['courses']);
     $data['courses'] = $courses_csv;
     $return = parent::save($data);
     return $return;
 }
开发者ID:anawu2006,项目名称:PeerLearning,代码行数:7,代码来源:bundle.php

示例5: save

 public function save($data)
 {
     $success = parent::save($data);
     if ($success) {
         // request option list
         $values = JRequest::getVar('joomdoc_option_value', array(), 'default', 'array');
         $labels = JRequest::getVar('joomdoc_option_label', array(), 'default', 'array');
         // prepare database table
         $option = JTable::getInstance('Option', JOOMDOC_TABLE_PREFIX);
         /* @var $option JoomDOCTableOption */
         $option->field = $this->getState($this->getName() . '.id');
         $option->ordering = 0;
         $query = $this->getDbo()->getQuery(true);
         $query->select('id')->from('#__joomdoc_option')->where('field = ' . (int) $option->field);
         $ids = $this->getDbo()->setQuery($query)->loadColumn();
         $sid = array();
         foreach ($values as $id => $value) {
             $option->id = in_array($id, $ids) ? $id : null;
             $option->value = $value;
             $option->label = $labels[$id];
             $option->ordering++;
             $option->store();
             $sid[] = (int) $option->id;
         }
         $query->clear()->delete('#__joomdoc_option')->where('field = ' . (int) $option->field);
         if ($sid) {
             $query->where('id NOT IN (' . implode(', ', $sid) . ')');
         }
         $this->getDbo()->setQuery($query)->query();
     }
     return $success;
 }
开发者ID:abdullah929,项目名称:bulletin,代码行数:32,代码来源:field.php

示例6: save

 public function save($form)
 {
     $canDo = JoaktreeHelper::getActions();
     $msg = JText::_('JTAPPS_MESSAGE_NOSAVE');
     if ($canDo->get('core.create') || $canDo->get('core.edit')) {
         $ret = parent::save($form);
         if ($ret) {
             $msg = JText::_('JT_MESSAGE_SAVED');
         }
         // Bind the rules.
         if (isset($form['rules'])) {
             $actions = array();
             $tmp = array();
             $tmp[0] = '';
             foreach ($data['rules'] as $action => $identities) {
                 $identities = array_diff($identities, $tmp);
                 $actions[$action] = $identities;
             }
             $table = $this->getTable();
             $rules = new JRules($actions);
             $table->setRules($rules);
         }
     }
     return $msg;
 }
开发者ID:Lothurm,项目名称:J3.x,代码行数:25,代码来源:jt_application.php

示例7: save

 public function save($data)
 {
     if (parent::save($data)) {
         $formId = $this->getState($this->getName() . '.id');
         $db = JFactory::getDBO();
         $query = 'DELETE  FROM `#__baforms_columns` WHERE `form_id`=' . $formId;
         $db->setQuery($query);
         $db->query();
         $query = 'DELETE  FROM `#__baforms_items` WHERE `form_id`=' . $formId;
         $db->setQuery($query);
         $db->query();
         $newdata = explode('|', $data['form_columns']);
         foreach ($newdata as $dat) {
             if ($dat != '') {
                 $table = JTable::getInstance('Columns', 'FormsTable');
                 $table->bind(array('form_id' => $formId, 'settings' => $dat));
                 $table->store();
             }
         }
         $newdata = explode('|_-_|', $data['form_content']);
         foreach ($newdata as $dat) {
             if ($dat != '') {
                 $table = JTable::getInstance('Items', 'FormsTable');
                 $table->bind(array('form_id' => $formId, 'column_id' => '2', 'settings' => $dat));
                 $table->store();
             }
         }
         return true;
     } else {
         return false;
     }
 }
开发者ID:pupsikus,项目名称:bs.test,代码行数:32,代码来源:form.php

示例8: save

 public function save($data)
 {
     //$data['begin'] = sprintf("%u", ip2long(long2ip(ip2long($data['begin']))));
     //$data['end'] = sprintf("%u", ip2long(long2ip(ip2long($data['end']))));
     $data['begin'] = sprintf("%010u", ip2long($data['begin']));
     $data['end'] = sprintf("%010u", ip2long($data['end']));
     parent::save($data);
 }
开发者ID:solderzzc,项目名称:com_tracker,代码行数:8,代码来源:banhost.php

示例9: save

 public function save($data)
 {
     if (parent::save($data)) {
         $this->updateCounter();
         return true;
     } else {
         return false;
     }
 }
开发者ID:Tommar,项目名称:remate,代码行数:9,代码来源:comment.php

示例10: save

 public function save($data)
 {
     $app = JFactory::getApplication();
     if ($app->input->get('task') == 'save' || $app->input->get('task') == "apply") {
         $object->type = $data['type'];
         $object->unit = $data['unit'];
         $data['params'] = json_encode($object);
     }
     return parent::save($data);
 }
开发者ID:hixbotay,项目名称:executivetransport,代码行数:10,代码来源:addon.php

示例11: save

 /**
  * Method to save the form data.
  *
  * @param   array  $data  The form data.
  *
  * @return  boolean  True on success, False on error.
  *
  * @since   12.2
  */
 public function save($data)
 {
     if (isset($data['alias']) && empty($data['alias'])) {
         /** @noinspection PhpUndefinedClassInspection */
         $data['alias'] = ru_RULocalise::transliterate($data['manufacturer_name']);
         $data['alias'] = preg_replace('#\\W#', '-', $data['alias']);
         $data['alias'] = preg_replace('#[-]+#', '-', $data['alias']);
     }
     return parent::save($data);
 }
开发者ID:saity74,项目名称:com_catalogue,代码行数:19,代码来源:manufacturer.php

示例12: save

 /**
  * Method to save the form data.
  *
  * @param   array  $data  The form data.
  *
  * @return  boolean  True on success.
  *
  * @since    3.0
  */
 public function save($data)
 {
     /*		echo '<pre>';
     			print_r($data);
     		echo '</pre>';
     
     		exit();*/
     parent::save($data);
     return true;
 }
开发者ID:simon6023,项目名称:dufslider,代码行数:19,代码来源:dufslider.php

示例13: save

 public function save($data)
 {
     $app = JFactory::getApplication();
     if ($app->input->get('task') == 'save2copy') {
         list($title, $alias) = $this->pageGenerateNewTitle($data['alias'], $data['title']);
         $data['title'] = $title;
         $data['alias'] = $alias;
     }
     parent::save($data);
     return true;
 }
开发者ID:naka211,项目名称:myloyal,代码行数:11,代码来源:page.php

示例14: save

 public function save($data)
 {
     $app = JFactory::getApplication();
     $param = $app->input->get('params', array(), 'array');
     $item = $this->getItem($data['id']);
     $params = (object) $item->params;
     $params->flight_number = $param['flight_number'];
     $params->return_flight_number = $param['return_flight_number'];
     $data['params'] = json_encode($params);
     return parent::save($data);
 }
开发者ID:hixbotay,项目名称:executivetransport,代码行数:11,代码来源:transportreport.php

示例15: save

 public function save($data)
 {
     $app = JFactory::getApplication();
     if ($app->input->get('task') == 'save' || $app->input->get('task') == "apply") {
         $jfom = $app->input->get('jform', array(), 'array');
         $params = array();
         $params['price_per_distance'] = $jfom['price_per_distance'];
         $data['params'] = json_encode($params);
     }
     return parent::save($data);
 }
开发者ID:hixbotay,项目名称:executivetransport,代码行数:11,代码来源:vehicle.php


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