Move matching of categories in SQL statements to a separate functions

This commit is contained in:
Alexander Nicolaysen Sørnes
2009-08-09 15:38:38 +02:00
parent e40aec5d84
commit 0fe5512f08
2 changed files with 19 additions and 16 deletions

View File

@@ -176,6 +176,23 @@ class Category {
return $aCats;
}
/* Returns an SQL statement that will match items in the current category
and all sub-categories */
public function getSqlQueryPart()
{
$sRet = '';
$aSubCats = $this->getSubCatList();
$sRet .= " ( catId = '{$this->iCatId}' ";
foreach($aSubCats as $oCat)
{
$iCatId = $oCat->objectGetId();
$sRet .= " OR catId = '$iCatId' ";
}
$sRet .= ") ";
return $sRet;
}
function objectGetMail($sAction, $bMailSubmitter, $bParentAction)
{
/* We don't send notification mails */