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


PHP DataObject::dbupdate方法代码示例

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


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

示例1: dbupdate

 /**
  * Update the DB based on previously recorded changes
  */
 function dbupdate()
 {
     global $DB;
     $DB->begin();
     parent::dbupdate();
     // Update/Insert/Delete custom fields
     $this->dbsave_custom_fields();
     $DB->commit();
 }
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:12,代码来源:_itemtype.class.php

示例2: dbupdate

 /**
  * Update the DB based on previously recorded changes
  */
 function dbupdate()
 {
     global $DB;
     $DB->begin();
     parent::dbupdate();
     if (isset($this->CollectionSettings)) {
         $this->CollectionSettings->dbupdate();
     }
     $DB->commit();
 }
开发者ID:LFSF,项目名称:oras,代码行数:13,代码来源:_blog.class.php

示例3: dbupdate

 /**
  * Update the DB based on previously recorded changes
  */
 function dbupdate()
 {
     global $DB;
     $DB->begin();
     parent::dbupdate();
     // Update group permissions/settings of the current group
     $GroupSettings =& $this->get_GroupSettings();
     $GroupSettings->dbupdate($this->ID);
     $DB->commit();
 }
开发者ID:ldanielz,项目名称:uesp.blog,代码行数:13,代码来源:_group.class.php

示例4: dbupdate

 /**
  * Update the DB based on previously recorded changes
  */
 function dbupdate()
 {
     global $DB, $Plugins, $servertimenow;
     $DB->begin();
     parent::dbupdate();
     // if this blog settings was modified we need to invalidate this blog's page caches
     // this way all existing cached page on this blog will be regenerated during next display
     // TODO: Ideally we want to detect if the changes are minor/irrelevant to caching and not invalidate the page cache if not necessary.
     // In case of doubt (and for unknown changes), it's better to invalidate.
     $this->set_setting('last_invalidation_timestamp', $servertimenow);
     if (isset($this->CollectionSettings)) {
         $this->CollectionSettings->dbupdate();
     }
     $Plugins->trigger_event('AfterCollectionUpdate', $params = array('Blog' => &$this));
     $DB->commit();
     // Thick grained invalidation:
     // This collection has been modified, cached content depending on it should be invalidated:
     BlockCache::invalidate_key('coll_ID', $this->ID);
     // Fine grained invalidation:
     // EXPERIMENTAL: Below are more granular invalidation dates:
     BlockCache::invalidate_key('set_coll_ID', $this->ID);
     // Settings have changed
     BlockCache::invalidate_key('set_coll_ID', 'any');
     // Settings of a have changed (for widgets tracking a change on ANY blog)
     // cont_coll_ID  // Content has not changed
 }
开发者ID:ldanielz,项目名称:uesp.blog,代码行数:29,代码来源:_blog.class.php

示例5: dbupdate

    /**
     * Trigger event AfterCommentUpdate after calling parent method.
     *
     * @return boolean true on success
     */
    function dbupdate()
    {
        global $Plugins, $DB;
        $dbchanges = $this->dbchanges;
        if (count($dbchanges)) {
            $this->set_last_touched_date();
        }
        $DB->begin();
        if (($r = parent::dbupdate()) !== false) {
            $update_item_last_touched_date = false;
            if (isset($dbchanges['comment_content']) || isset($dbchanges['comment_renderers'])) {
                // Content is updated
                $this->delete_prerendered_content();
                $update_item_last_touched_date = true;
            }
            if ($this->check_publish_status_changed()) {
                // Comment is updated into/out some public status
                $update_item_last_touched_date = true;
            }
            if (!empty($this->previous_item_ID)) {
                // Comment is moved from another post
                $ItemCache =& get_ItemCache();
                $ItemCache->clear();
                if ($previous_Item =& $ItemCache->get_by_ID($this->previous_item_ID, false, false)) {
                    // Update last touched date of previous item
                    $previous_Item->update_last_touched_date(false);
                }
                // Also update new post
                $update_item_last_touched_date = true;
                // Also move all child comments to new post
                $child_comment_IDs = $this->get_child_comment_IDs();
                if (count($child_comment_IDs)) {
                    $DB->query('UPDATE T_comments
						  SET comment_item_ID = ' . $DB->quote($this->item_ID) . '
						WHERE comment_ID IN ( ' . $DB->quote($child_comment_IDs) . ' )');
                }
            }
            $this->update_last_touched_date($update_item_last_touched_date);
            $DB->commit();
            $Plugins->trigger_event('AfterCommentUpdate', $params = array('Comment' => &$this, 'dbchanges' => $dbchanges));
        } else {
            $DB->rollback();
        }
        return $r;
    }
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:50,代码来源:_comment.class.php

示例6: dbupdate

 /**
  * Update the DB based on previously recorded changes
  *
  * @return boolean true on success, false on failure / no changes
  */
 function dbupdate()
 {
     if ($this->meta == 'unknown') {
         debug_die('cannot update File if meta data has not been checked before');
     }
     global $DB;
     $DB->begin();
     // Let parent do the update:
     if (($r = parent::dbupdate()) !== false) {
         // Update field 'last_touched_ts' of each item that has a link with this edited file
         $LinkCache =& get_LinkCache();
         $links = $LinkCache->get_by_file_ID($this->ID);
         foreach ($links as $Link) {
             $LinkOwner =& $Link->get_LinkOwner();
             if ($LinkOwner != NULL) {
                 $LinkOwner->item_update_last_touched_date();
             }
         }
         $DB->commit();
     } else {
         $DB->rollback();
     }
     return $r;
 }
开发者ID:ldanielz,项目名称:uesp.blog,代码行数:29,代码来源:_file.class.php

示例7: dbupdate

    /**
     * Update the DB based on previously recorded changes.
     *
     * Triggers the plugin event AfterUserUpdate.
     */
    function dbupdate()
    {
        global $DB, $Plugins, $current_User, $localtimenow;
        $DB->begin();
        $result = parent::dbupdate();
        // Update existing fields:
        if (!empty($this->updated_fields)) {
            foreach ($this->updated_fields as $uf_ID => $uf_val) {
                // Note the updated_fields key values must be integers, so don't need casting or DB->quote()
                if (empty($uf_val)) {
                    // Delete field:
                    $DB->query('DELETE FROM T_users__fields
														 WHERE uf_ID = ' . $uf_ID);
                } else {
                    // Update field:
                    $DB->query('UPDATE T_users__fields
													SET uf_varchar = ' . $DB->quote($uf_val) . '
												WHERE uf_ID = ' . $uf_ID);
                }
            }
            // Reset updated fields in object:
            $this->updated_fields = array();
        }
        // Add new fields:
        if (!empty($this->new_fields)) {
            $sql = 'INSERT INTO T_users__fields( uf_user_ID, uf_ufdf_ID, uf_varchar )
							VALUES (' . $this->ID . ', ' . implode('), (' . $this->ID . ', ', $this->new_fields) . ' )';
            $DB->query($sql, 'Insert new fields');
            // Reset new fields in object:
            $this->new_fields = array();
        }
        // Notify plugins:
        // Example: An authentication plugin could synchronize/update the password of the user.
        $Plugins->trigger_event('AfterUserUpdate', $params = array('User' => &$this));
        $DB->commit();
        // BLOCK CACHE INVALIDATION:
        // This User has been modified, cached content depending on it should be invalidated:
        BlockCache::invalidate_key('user_ID', $this->ID);
        return true;
    }
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:45,代码来源:_user.class.php

示例8: dbupdate

 /**
  * Update the DB based on previously recorded changes
  *
  * @return boolean true on success
  */
 function dbupdate()
 {
     global $DB;
     // Start transaction because of urltitle validation
     $DB->begin('SERIALIZABLE');
     // validate url title / slug
     if (empty($this->urlname) || isset($this->dbchanges['cat_urlname'])) {
         // Url title has changed or is empty
         $this->set('urlname', urltitle_validate($this->urlname, $this->name, $this->ID, false, $this->dbprefix . 'urlname', $this->dbIDname, $this->dbtablename));
     }
     if (count($this->dbchanges) > 0 && !isset($this->dbchanges['last_touched_ts'])) {
         // Update last_touched_ts field only if it wasn't updated yet and the datemodified will be updated for sure.
         global $localtimenow;
         $this->set_param('last_touched_ts', 'date', date('Y-m-d H:i:s', $localtimenow));
     }
     if (parent::dbupdate() === false) {
         // The update was unsuccessful
         $DB->rollback();
         return false;
     }
     // The chapter was updated successful
     $DB->commit();
     return true;
 }
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:29,代码来源:_chapter.class.php

示例9: dbupdate

 /**
  * Update the DB based on previously recorded changes
  *
  * @return boolean true
  */
 function dbupdate()
 {
     global $DB;
     $DB->begin();
     if (parent::dbupdate() !== false) {
         // Skin updated, also save containers:
         $this->db_save_containers();
     }
     $DB->commit();
     return true;
 }
开发者ID:ldanielz,项目名称:uesp.blog,代码行数:16,代码来源:_skin.class.php

示例10: dbupdate

 /**
  * Update the DB based on previously recorded changes
  *
  * @return boolean true on success, false on failure / no changes
  */
 function dbupdate()
 {
     if ($this->meta == 'unknown') {
         debug_die('cannot update File if meta data has not been checked before');
     }
     // Let parent do the update:
     return parent::dbupdate();
 }
开发者ID:LFSF,项目名称:oras,代码行数:13,代码来源:_file.class.php

示例11: dbupdate

 /**
  * Update the DB based on previously recorded changes.
  *
  * @todo dh> this is very Item specific, and should get fixed probably.
  *
  * @return boolean true on success
  */
 function dbupdate()
 {
     global $DB, $Messages;
     $ItemCache =& get_ItemCache();
     $Item =& $ItemCache->get_by_id($this->itm_ID);
     $DB->begin();
     if ($Item->get('canonical_slug_ID') == $this->ID) {
         $Item->set('urltitle', $this->title);
         if (!$Item->dbupdate(true, false, false)) {
             $DB->rollback();
             return false;
         }
         $Messages->add(sprintf(T_('Warning: this change also changed the canonical slug of the post! (%s)'), $this->get_link_to_object()), 'warning');
     }
     parent::dbupdate();
     $DB->commit();
     return true;
 }
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:25,代码来源:_slug.class.php

示例12: dbupdate

 /**
  * Update the DB based on previously recorded changes
  *
  * @return boolean true on success, false on failure to update, NULL if no update necessary
  */
 function dbupdate()
 {
     global $DB;
     $dbchanges = $this->dbchanges;
     $DB->begin();
     if (($r = parent::dbupdate()) !== false) {
         // Update types of the Files
         $this->update_file_types();
         $DB->commit();
     } else {
         $DB->rollback();
     }
     return $r;
 }
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:19,代码来源:_filetype.class.php

示例13: dbupdate

 /**
  * Update the DB based on previously recorded changes
  *
  * @return boolean true on success, false on failure / no changes
  */
 function dbupdate()
 {
     if ($this->meta == 'unknown') {
         debug_die('cannot update File if meta data has not been checked before');
     }
     global $DB;
     $DB->begin();
     $file_path_hash = md5($this->_FileRoot->type . $this->_FileRoot->in_type_ID . $this->_rdfp_rel_path, true);
     if ($file_path_hash != $this->path_hash) {
         // The file path was changed
         $this->set_param('path_hash', 'string', $file_path_hash);
     }
     // Let parent do the update:
     if (($r = parent::dbupdate()) !== false) {
         // Update field 'last_touched_ts' of each item that has a link with this edited file
         $LinkCache =& get_LinkCache();
         $links = $LinkCache->get_by_file_ID($this->ID);
         foreach ($links as $Link) {
             $LinkOwner =& $Link->get_LinkOwner();
             if ($LinkOwner != NULL) {
                 $LinkOwner->update_last_touched_date();
             }
         }
         $DB->commit();
     } else {
         $DB->rollback();
     }
     return $r;
 }
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:34,代码来源:_file.class.php

示例14: dbupdate

 /**
  * Trigger event AfterCommentUpdate after calling parent method.
  *
  * @return boolean true on success
  */
 function dbupdate()
 {
     global $Plugins;
     $dbchanges = $this->dbchanges;
     if ($r = parent::dbupdate()) {
         $Plugins->trigger_event('AfterCommentUpdate', $params = array('Comment' => &$this, 'dbchanges' => $dbchanges));
     }
     return $r;
 }
开发者ID:LFSF,项目名称:oras,代码行数:14,代码来源:_comment.class.php

示例15: dbupdate

 /**
  * Trigger event AfterCommentUpdate after calling parent method.
  *
  * @return boolean true on success
  */
 function dbupdate()
 {
     global $Plugins, $DB;
     $dbchanges = $this->dbchanges;
     $DB->begin();
     if (($r = parent::dbupdate()) !== false) {
         if (isset($dbchanges['comment_content']) || isset($dbchanges['comment_renderers'])) {
             $this->delete_prerendered_content();
         }
         if ($this->check_publish_status_changed()) {
             // Update last touched date of item if comment is updated into/out some public status
             $comment_Item =& $this->get_Item();
             $comment_Item->update_last_touched_date();
         }
         $DB->commit();
         $Plugins->trigger_event('AfterCommentUpdate', $params = array('Comment' => &$this, 'dbchanges' => $dbchanges));
     } else {
         $DB->rollback();
     }
     return $r;
 }
开发者ID:ldanielz,项目名称:uesp.blog,代码行数:26,代码来源:_comment.class.php


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