本文整理汇总了PHP中History::removeByIssues方法的典型用法代码示例。如果您正苦于以下问题:PHP History::removeByIssues方法的具体用法?PHP History::removeByIssues怎么用?PHP History::removeByIssues使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类History
的用法示例。
在下文中一共展示了History::removeByIssues方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: removeByProjects
/**
* Method used to remove all issues associated with a specific list of
* projects.
*
* XXX: this is dangerous, maybe remove such methods?
*
* @param array $ids The list of projects to look for
* @return boolean
*/
public static function removeByProjects($ids)
{
$stmt = 'SELECT
iss_id
FROM
{{%issue}}
WHERE
iss_prj_id IN (' . DB_Helper::buildList($ids) . ')';
try {
$res = DB_Helper::getInstance()->getColumn($stmt, $ids);
} catch (DbException $e) {
return false;
}
if (count($res) > 0) {
self::deleteAssociations($res);
Attachment::removeByIssues($res);
SCM::removeByIssues($res);
Impact_Analysis::removeByIssues($res);
self::deleteUserAssociations($res);
Note::removeByIssues($res);
Time_Tracking::removeTimeEntriesByIssues($res);
Notification::removeByIssues($res);
Custom_Field::removeByIssues($res);
Phone_Support::removeByIssues($res);
History::removeByIssues($res);
// now really delete the issues
$items = implode(', ', $res);
$stmt = "DELETE FROM\n {{%issue}}\n WHERE\n iss_id IN ({$items})";
DB_Helper::getInstance()->query($stmt);
}
return true;
}
示例2: removeByProjects
/**
* Method used to remove all issues associated with a specific list of
* projects.
*
* @access public
* @param array $ids The list of projects to look for
* @return boolean
*/
function removeByProjects($ids)
{
$items = @implode(", ", Misc::escapeInteger($ids));
$stmt = "SELECT\n iss_id\n FROM\n " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue\n WHERE\n iss_prj_id IN ({$items})";
$res = $GLOBALS["db_api"]->dbh->getCol($stmt);
if (PEAR::isError($res)) {
Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);
return false;
} else {
if (count($res) > 0) {
Issue::deleteAssociations($res);
Attachment::removeByIssues($res);
SCM::removeByIssues($res);
Impact_Analysis::removeByIssues($res);
Issue::deleteUserAssociations($res);
Note::removeByIssues($res);
Time_Tracking::removeByIssues($res);
Notification::removeByIssues($res);
Custom_Field::removeByIssues($res);
Phone_Support::removeByIssues($res);
History::removeByIssues($res);
// now really delete the issues
$items = implode(", ", $res);
$stmt = "DELETE FROM\n " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue\n WHERE\n iss_id IN ({$items})";
$GLOBALS["db_api"]->dbh->query($stmt);
}
return true;
}
}