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


PHP XoopsPersistableObjectHandler::cleanOrphan方法代码示例

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


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

示例1: cleanOrphan

 /**
  * clean orphan links from database
  * 
  * @return     bool    true on success
  */
 function cleanOrphan()
 {
     return parent::cleanOrphan($this->db->prefix("tag_tag"), "tag_id");
 }
开发者ID:trabisdementia,项目名称:xuups,代码行数:9,代码来源:link.php

示例2: cleanOrphan

 /**
  * clean orphan items from database
  *
  * @return     bool    true on success
  */
 function cleanOrphan()
 {
     return parent::cleanOrphan($this->db->prefix("bb_topics"), "topic_id");
 }
开发者ID:trabisdementia,项目名称:xuups,代码行数:9,代码来源:rate.php

示例3: cleanOrphan

 /**
  * clean orphan items from database
  * 
  * @return     bool    true on success
  */
 function cleanOrphan()
 {
     parent::cleanOrphan($this->db->prefix("bb_categories"), "cat_id");
     if (version_compare(mysql_get_server_info(), "4.1.0", "ge")) {
         /*
         $sql = "DELETE FROM ".$this->table.
                 " WHERE (parent_forum >0 AND parent_forum NOT IN ( SELECT DISTINCT forum_id FROM ".$this->table.") )";
         */
         $sql = "    DELETE {$this->table} FROM {$this->table}" . "    LEFT JOIN {$this->table} AS aa ON {$this->table}.parent_forum = aa.forum_id " . "    WHERE {$this->table}.parent_forum>0 AND (aa.forum_id IS NULL)";
         if (!($result = $this->db->queryF($sql))) {
             //xoops_error("cleanOrphan error:". $sql);
         }
     } else {
         $this->identifierName = "parent_forum";
         $forum_list = $this->getList(new Criteria("parent_forum", 0, ">"));
         $this->identifierName = "forum_name";
         if ($parent_forums = @array_values($forum_list)) {
             $parent_list = $this->getIds(new Criteria("forum_id", "(" . implode(", ", $parent_forums) . ")", "IN"));
             foreach ($forum_list as $forum_id => $parent_forum) {
                 if (in_array($parent_forum, $parent_list)) {
                     continue;
                 }
                 $forum_obj =& $this->get($forum_id);
                 $this->delete($forum_obj);
                 unset($forum_obj);
             }
         }
     }
     return true;
 }
开发者ID:BackupTheBerlios,项目名称:haxoo-svn,代码行数:35,代码来源:forum.php

示例4: cleanOrphan

 /**
  * clean orphan items from database
  *
  * @return     bool    true on success
  */
 function cleanOrphan()
 {
     $this->deleteAll(new Criteria("topic_time", 0), true, true);
     parent::cleanOrphan($this->db->prefix("bb_forums"), "forum_id");
     parent::cleanOrphan($this->db->prefix("bb_posts"), "topic_id");
     return true;
 }
开发者ID:trabisdementia,项目名称:xuups,代码行数:12,代码来源:topic.php

示例5: cleanOrphan

 /**
  * clean orphan items from database
  *
  * @return     bool    true on success
  */
 function cleanOrphan()
 {
     $this->deleteAll(new Criteria("post_time", 0), true, true);
     parent::cleanOrphan($this->db->prefix("bb_topics"), "topic_id");
     parent::cleanOrphan($this->db->prefix("bb_posts_text"), "post_id");
     /* for MySQL 4.1+ */
     if (version_compare(mysql_get_server_info(), "4.1.0", "ge")) {
         $sql = "DELETE FROM " . $this->db->prefix("bb_posts_text") . " WHERE (post_id NOT IN ( SELECT DISTINCT post_id FROM {$this->table}) )";
     } else {
         // for 4.0+
         /* */
         $sql = "DELETE " . $this->db->prefix("bb_posts_text") . " FROM " . $this->db->prefix("bb_posts_text") . " LEFT JOIN {$this->table} AS aa ON " . $this->db->prefix("bb_posts_text") . ".post_id = aa.post_id " . " WHERE (aa.post_id IS NULL)";
         /* */
         // Alternative for 4.1+
         /*
         $sql =     "DELETE bb FROM ".$this->db->prefix("bb_posts_text")." AS bb".
         " LEFT JOIN ".$this->table." AS aa ON bb.post_id = aa.post_id ".
         " WHERE (aa.post_id IS NULL)";
         */
     }
     if (!($result = $this->db->queryF($sql))) {
         //xoops_error($this->db->error());
         return false;
     }
     return true;
 }
开发者ID:trabisdementia,项目名称:xuups,代码行数:31,代码来源:post.php


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