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


PHP unknown_type::update方法代码示例

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


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

示例1: save

 /**
  * Method to save records (insert or update)
  * @see application/controllers/ICrudController#save()
  */
 public function save(array $data, array $unlockedData)
 {
     try {
         if (isset($this->_post->Insert)) {
             $this->_model->insert($data);
         } else {
             $fieldKey = $this->_model->getFieldKey();
             $this->_model->update($data, "{$fieldKey} = {$unlockedData[$fieldKey]}");
         }
     } catch (Exception $e) {
         Fgsl_Session_Namespace::set('exception', $e);
         $this->_redirect('error/message');
     }
     return true;
 }
开发者ID:rogeriopradoj,项目名称:temostudo,代码行数:19,代码来源:Abstract.php

示例2: foreach

 /**
  * Perform term count update immediately.
  *
  * @since 2.5.0
  *
  * @param array $terms The term_taxonomy_id of terms to update.
  * @param string $taxonomy The context of the term.
  * @return bool Always true when complete.
  */
 function update_term_count_now($terms, $taxonomy)
 {
     $terms = array_map('intval', $terms);
     $taxonomy = $this->get_taxonomy($taxonomy);
     if (!empty($taxonomy->update_count_callback)) {
         call_user_func($taxonomy->update_count_callback, $terms);
     } else {
         // Default count updater
         foreach ((array) $terms as $term) {
             $count = $this->db->get_var($this->db->prepare("SELECT COUNT(*) FROM {$this->db->term_relationships} WHERE term_taxonomy_id = %d", $term));
             $this->db->update($this->db->term_taxonomy, compact('count'), array('term_taxonomy_id' => $term));
         }
     }
     $this->clean_term_cache($terms);
     return true;
 }
开发者ID:nxtclass,项目名称:NXTClass,代码行数:25,代码来源:class.nxt-taxonomy.php

示例3: addPage

 /**
  * Add the specified page to the specified tree
  * Remember to also call StructuredData::addWatch if you call this function
  *
  * @param unknown_type $dbw
  * @param unknown_type $treeId
  * @param unknown_type $title
  * @param unknown_type $revid
  * @param unknown_type $talkRevid
  * @param unknown_type $dataVersion
  * @param unknown_type $uid
  * @param unknown_type $flags
  * @return unknown
  */
 public static function addPage($dbw, &$user, $treeId, $title, $revid, $talkRevid, $dataVersion = 0, $uid = '', $flags = 0)
 {
     $result = true;
     // should this be the primary person?
     // TODO get rid of this test - the primary person can be set when the user opens the tree for the first time
     if ($title->getNamespace() == NS_PERSON) {
         $res = $dbw->select('familytree_page', 'fp_title', array('fp_tree_id' => $treeId, 'fp_namespace' => NS_PERSON), 'FamilyTreeUtil::addPage', array('LIMIT' => 1));
         if ($res === false || !$dbw->numRows($res)) {
             // make this person the primary page if it's the first person
             $dbw->update('familytree', array('ft_primary_namespace' => $title->getNamespace(), 'ft_primary_title' => $title->getDBkey()), array('ft_tree_id' => $treeId));
             FamilyTreeUtil::deleteFamilyTreesCache($user->getName());
             $errno = $dbw->lastErrno();
             if ($errno > 0) {
                 $result = false;
             }
         }
         $dbw->freeResult($res);
     }
     // insert familytree_page
     $record = array('fp_tree_id' => $treeId, 'fp_user_id' => $user->getID(), 'fp_namespace' => $title->getNamespace(), 'fp_title' => $title->getDBkey(), 'fp_oldid' => $revid, 'fp_latest' => $revid, 'fp_talk_oldid' => $talkRevid, 'fp_talk_latest' => $talkRevid, 'fp_data_version' => $dataVersion, 'fp_uid' => $uid, 'fp_flags' => $flags);
     $dbw->insert('familytree_page', $record, 'FamilyTreeUtil::addPage', array('ignore'));
     $errno = $dbw->lastErrno();
     if ($errno != 0 && $errno != 1062) {
         // 1062 = duplicate key
         $result = false;
     }
     return $result;
 }
开发者ID:k-hasan-19,项目名称:wiki,代码行数:42,代码来源:FamilyTreeUtil.php


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