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


PHP Base_model::save方法代码示例

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


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

示例1: save

 /**
  * 统计修改
  * @param  array   $data 修改字段信息
  * @param  integer $id   传入uid
  * @return bool        
  */
 public function save($data = array(), $id = 0)
 {
     $result = parent::save($data, $id);
     if (is_null($result)) {
         return false;
     } else {
         return true;
     }
 }
开发者ID:shuai959980629,项目名称:TTDV1,代码行数:15,代码来源:User_account_count_model.php

示例2: save

 public function save($inputs)
 {
     // Arrays of data which will be saved
     $data = array();
     // Fields of the key table
     $fields = $this->list_fields();
     // Set the data to the posted value.
     foreach ($fields as $field) {
         $data[$field] = $inputs[$field];
     }
     return parent::save($data);
 }
开发者ID:pompalini,项目名称:emngo,代码行数:12,代码来源:api_key_model.php

示例3: save

 /**
  * Overload Parent
  */
 function save($data)
 {
     parent::save($data);
     if (is_array($data)) {
         $data = (object) $data;
     }
     //save gl
     $kas = new Jurnal_entry();
     $kas->nomor_account = $this->cash_account;
     $kas->kredit_value = (double) $data->jumlah;
     $kas->debit_value = 0;
     $kas->tgl_transaksi = $data->tgl_transaksi;
     $kas->nomor_dokumen = "";
     $pengeluaran = new Jurnal_entry();
     $pengeluaran->nomor_account = $this->kode_account;
     $pengeluaran->debit_value = (double) $data->jumlah;
     $pengeluaran->kredit_value = 0;
     $pengeluaran->tgl_transaksi = $data->tgl_transaksi;
     $pengeluaran->nomor_dokumen = "";
     //kas berkurang
     //pengeluaran bertambah
     $result = $this->Gledger->write_jurnal($pengeluaran, $kas);
 }
开发者ID:ibnoe,项目名称:kosimpin,代码行数:26,代码来源:pengeluaran.php

示例4: save

 public function save($inputs)
 {
     // Arrays of data which will be saved
     $data = $data_lang = array();
     // Fields of the author table
     $fields = $this->list_fields();
     // Set the data to the posted value.
     foreach ($fields as $field) {
         $data[$field] = $inputs[$field];
     }
     $lang_fields = $this->list_fields($this->_author_lang_table);
     foreach (Settings::get_languages() as $language) {
         foreach ($lang_fields as $field) {
             if ($field != $this->pk_name && $field != 'lang') {
                 $input_field = $field . '_' . $language['lang'];
                 if ($inputs[$input_field] !== FALSE) {
                     $data_lang[$language['lang']][$field] = $inputs[$input_field];
                 }
             }
         }
     }
     return parent::save($data, $data_lang);
 }
开发者ID:pompalini,项目名称:emngo,代码行数:23,代码来源:demo_author_model.php

示例5: save

 /**
  * Saves the article
  *
  * @param 	array	Standard data table
  * @param 	array	Lang depending data table
  *
  * @return	int		Articles saved ID
  *
  */
 function save($data, $lang_data)
 {
     // New article : Created field
     if (!$data['id_article']) {
         $data['created'] = $data['updated'] = date('Y-m-d H:i:s');
     } else {
         $data['updated'] = date('Y-m-d H:i:s');
     }
     // Be sure URLs are unique
     $this->set_unique_urls($lang_data, $data['id_article']);
     // Dates
     $data['publish_on'] = $data['publish_on'] ? getMysqlDatetime($data['publish_on']) : '0000-00-00';
     $data['publish_off'] = $data['publish_off'] ? getMysqlDatetime($data['publish_off']) : '0000-00-00';
     $data['comment_expire'] = $data['comment_expire'] ? getMysqlDatetime($data['comment_expire']) : '0000-00-00';
     $data['logical_date'] = $data['logical_date'] ? getMysqlDatetime($data['logical_date']) : '0000-00-00';
     // Article saving
     return parent::save($data, $lang_data);
 }
开发者ID:BGCX261,项目名称:zillatek-project-svn-to-git,代码行数:27,代码来源:article_model.php

示例6: save

 /**
  * Saves one media data
  *
  * @param	array	standard data array
  * @param	array	lang data array
  *
  * @return	string	Inserted / Updated media ID
  */
 public function save($data, $lang_data)
 {
     // Dates
     $data['date'] = $data['date'] ? getMysqlDatetime($data['date'], Settings::get('date_format')) : '0000-00-00';
     // Media saving
     return parent::save($data, $lang_data);
 }
开发者ID:trk,项目名称:ionize,代码行数:15,代码来源:media_model.php

示例7: _save_resource

 /**
  * Creates one resource if it doesn't exist, else updates it.
  *
  *
  * @param       $type
  * @param       $element		String. Can contain the element ID (eg. 'element/3')
  * @param array $actions
  * @param array $data
  *
  * @return int|null
  */
 private function _save_resource($type, $element, $actions = array(), $data = array())
 {
     $id_resource = NULL;
     // Correct NULL actions
     if (is_null($actions)) {
         $actions = array();
     }
     $resource = $type . '/' . $element;
     if (is_null($actions)) {
         $actions = array();
     }
     // Find out $id_parent
     $db_resource = $this->get_row_array(array('resource' => $resource));
     $data = array_merge(array('resource' => $resource, 'actions' => implode(',', $actions)), $data);
     // Get ID resource
     if (!empty($db_resource)) {
         $data['id_resource'] = $db_resource['id_resource'];
     }
     $id_resource = parent::save($data);
     return $id_resource;
 }
开发者ID:trk,项目名称:ionize,代码行数:32,代码来源:resource_model.php

示例8: save

 /**
  * Saves media meta data
  *
  * @param $post
  *
  * @return int|void
  */
 public function save($post)
 {
     foreach ($post as $key => $media) {
         if (substr($key, 0, 5) == 'media') {
             $data_lang = $media['lang'];
             parent::save($media, $data_lang);
         }
     }
 }
开发者ID:trk,项目名称:ionize,代码行数:16,代码来源:medialist_model.php

示例9: save

 /**
  * Saves the article
  *
  * @param 	array	$data		data table
  * @param 	array	$lang_data	Lang depending data table
  * @return	int		Articles saved ID
  */
 public function save($data, $lang_data)
 {
     // New article : Created field
     if (!$data['id_article'] or $data['id_article'] == '') {
         $data['created'] = $data['updated'] = date('Y-m-d H:i:s');
     } else {
         $data['updated'] = date('Y-m-d H:i:s');
     }
     // Dates
     $data = $this->_set_dates($data);
     // Article saving
     return parent::save($data, $lang_data);
 }
开发者ID:trk,项目名称:ionize,代码行数:20,代码来源:article_model.php

示例10: save

 /**
  * Saves one media data
  *
  * @param	array	standard data array
  * @param	array	lang data array
  *
  * @return	string	Inserted / Updated media ID
  */
 function save($data, $lang_data)
 {
     // Dates
     $data['date'] = $data['date'] ? getMysqlDatetime($data['date']) : '0000-00-00';
     // Media saving
     return parent::save($data, $lang_data);
 }
开发者ID:BGCX261,项目名称:zillatek-project-svn-to-git,代码行数:15,代码来源:media_model.php

示例11: save

 /** 
  * Saves one Page
  *
  * @param	array		$data		Page data table
  * @param	array		$lang_data	Page Lang depending data table
  * @return	int			The inserted / updated page ID
  */
 public function save($data, $lang_data)
 {
     // Dates
     $data = $this->_set_dates($data);
     // Correct level regarding to the parent
     if (isset($data['id_parent'])) {
         $parent_array = $this->get_parent_array($data['id_parent']);
         $data['level'] = count($parent_array);
     }
     // Correct child pages
     if (!empty($data['id_page'])) {
         $page = $this->get_by_id($data['id_page']);
         if ($page['id_menu'] != $data['id_menu']) {
             $this->update_pages_menu($data['id_page'], $data['id_menu']);
         }
     }
     // Clean meta data
     $lang_data = $this->_clean_meta_data($lang_data);
     // Base model save method call
     return parent::save($data, $lang_data);
 }
开发者ID:trk,项目名称:ionize,代码行数:28,代码来源:page_model.php

示例12: save

 /**
  * @param       $data
  * @param array $lang_data
  *
  * @return int
  */
 public function save($data, $lang_data)
 {
     // Name
     $data['name'] = url_title($data['name']);
     return parent::save($data, $lang_data);
 }
开发者ID:pompalini,项目名称:emngo,代码行数:12,代码来源:item_definition_model.php

示例13: save

 /** 
  * Saves one Page
  *
  * @param	array		Page data table
  * @param	array		Page Lang depending data table
  *
  * @return	string		The inserted / updated page ID
  *
  */
 function save($data, $lang_data)
 {
     // Dates
     $data['publish_on'] = $data['publish_on'] ? getMysqlDatetime($data['publish_on'], Settings::get('date_format')) : '0000-00-00';
     $data['publish_off'] = $data['publish_off'] ? getMysqlDatetime($data['publish_off'], Settings::get('date_format')) : '0000-00-00';
     $data['logical_date'] = $data['logical_date'] ? getMysqlDatetime($data['logical_date'], Settings::get('date_format')) : '0000-00-00';
     // Creation date
     if (!$data['id_page'] or $data['id_page'] == '') {
         $data['created'] = date('Y-m-d H:i:s');
     } else {
         $data['updated'] = date('Y-m-d H:i:s');
     }
     // Be sure URLs are unique
     $this->set_unique_urls($lang_data, $data['id_page']);
     // Clean metas data
     foreach ($lang_data as $lang => $row) {
         foreach ($row as $key => $value) {
             if ($key == 'meta_description') {
                 $lang_data[$lang][$key] = preg_replace('[\\"]', '', $value);
             }
             if ($key == 'meta_keywords') {
                 $lang_data[$lang][$key] = preg_replace('/[\\"\\.;]/i  ', '', $value);
             }
         }
     }
     // Base model save method call
     return parent::save($data, $lang_data);
 }
开发者ID:nbourguig,项目名称:ionize,代码行数:37,代码来源:page_model.php

示例14: save

 /**
  * Overload Parent
  */
 function save($data)
 {
     parent::save($data);
     if (is_array($data)) {
         $data = (object) $data;
     }
     //save gl
     $kas = new Jurnal_entry();
     $kas->nomor_account = $this->cash_account;
     $kas->debit_value = (double) $data->jumlah_in;
     $kas->kredit_value = 0;
     $kas->tgl_transaksi = $data->tgl_transaksi;
     $kas->nomor_dokumen = "";
     $tabungan = new Jurnal_entry();
     $tabungan->nomor_account = $this->kode_account;
     $tabungan->debit_value = 0;
     $tabungan->kredit_value = (double) $data->jumlah_in;
     $tabungan->tgl_transaksi = $data->tgl_transaksi;
     $tabungan->nomor_dokumen = "";
     $result = $this->GLedger->write_jurnal($kas, $tabungan);
 }
开发者ID:ibnoe,项目名称:kosimpin,代码行数:24,代码来源:tabungan.php


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