Ejemplo n.º 1
0
 /**
  * This functions returns the number of records that maches given conditions.
  */
 public static function recordsCount($year, $hspPlanId)
 {
     $selectTable = "`" . parent::DB_TABLE_HSP_SUMMARY . "`";
     $selectFields[0] = "COUNT(summary_id)";
     $selectConditions[0] = "`" . parent::DB_FIELD_HSP_PLAN_YEAR . "` = '" . $year . "'";
     $selectConditions[1] = parent::_twoHspPlansCondition($hspPlanId);
     $sqlBuilder = new SQLQBuilder();
     $query = $sqlBuilder->simpleSelect($selectTable, $selectFields, $selectConditions, null, null, null, true);
     $dbConnection = new DMLFunctions();
     $result = $dbConnection->executeQuery($query);
     $row = $dbConnection->dbObject->getArray($result);
     return $row[0];
 }