本文整理匯總了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");
}
示例2: cleanOrphan
/**
* clean orphan items from database
*
* @return bool true on success
*/
function cleanOrphan()
{
return parent::cleanOrphan($this->db->prefix("bb_topics"), "topic_id");
}
示例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;
}
示例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;
}
示例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;
}