예제 #1
0
function getCatIdAndType($catName)
{
    if ($catName == "All") {
        return null;
    }
    $catName = addslashes($catName);
    $catName = "'" . $catName . "'";
    $superCatId = DbItemSuperCategory::withConditions("WHERE superCategoryName = " . $catName)->getListOfColumn("superCategoryId");
    if (count($superCatId) > 0) {
        $id = $superCatId[0];
        $type = "super";
    } else {
        $subCatId = DbItemCategory::withConditions("WHERE categoryName = " . $catName)->getListOfColumn("categoryId");
        $id = $subCatId[0];
        $type = "sub";
    }
    return array("id" => $id, "type" => $type);
}
 public static function getSuperCategoriesList()
 {
     // Query for returning all super item categories stored in the db
     return DbItemSuperCategory::withConditions()->getListOfColumn("superCategoryName");
 }