Code Duplication    Length = 9-13 lines in 3 locations

catalog/includes/functions/general.php 3 locations

@@ 392-400 (lines=9) @@
389
////
390
// Return true if the category has subcategories
391
// TABLES: categories
392
  function tep_has_category_subcategories($category_id) {
393
    $OSCOM_Db = Registry::get('Db');
394
395
    $Qcheck = $OSCOM_Db->prepare('select categories_id from :table_categories where parent_id = :parent_id limit 1');
396
    $Qcheck->bindInt(':parent_id', $category_id);
397
    $Qcheck->execute();
398
399
    return ($Qcheck->fetch() !== false);
400
  }
401
402
////
403
// Returns the address_format_id for the given country
@@ 986-994 (lines=9) @@
983
984
////
985
// Check if product has attributes
986
  function tep_has_product_attributes($products_id) {
987
    $OSCOM_Db = Registry::get('Db');
988
989
    $Qattributes = $OSCOM_Db->prepare('select products_id from :table_products_attributes where products_id = :products_id limit 1');
990
    $Qattributes->bindInt(':products_id', $products_id);
991
    $Qattributes->execute();
992
993
    return $Qattributes->fetch() !== false;
994
  }
995
996
  function tep_count_modules($modules = '') {
997
    $count = 0;
@@ 1164-1176 (lines=13) @@
1161
////
1162
// Checks to see if the currency code exists as a currency
1163
// TABLES: currencies
1164
  function tep_currency_exists($code) {
1165
    $OSCOM_Db = Registry::get('Db');
1166
1167
    $Qcurrency = $OSCOM_Db->prepare('select code from :table_currencies where code = :code limit 1');
1168
    $Qcurrency->bindValue(':code', $code);
1169
    $Qcurrency->execute();
1170
1171
    if ($Qcurrency->fetch() !== false) {
1172
      return $Qcurrency->value('code');
1173
    }
1174
1175
    return false;
1176
  }
1177
1178
////
1179
// Parse and secure the cPath parameter values