/** * Get list of pay periods defined in the system * @return array Array of all pay periods defined in the system */ public static function getPayPeriodList() { $fields[0] = self::DB_FIELD_PAYPERIOD_NAME; $fields[1] = self::DB_FIELD_PAYPERIOD_CODE; $sql_builder = new SQLQBuilder(); $sql_builder->table_name = self::TABLE_NAME; $sql_builder->flg_select = 'true'; $sql_builder->arr_select = $fields; $sql = $sql_builder->queryAllInformation(); $dbConnection = new DMLFunctions(); $result = $dbConnection->executeQuery($sql); $periods = array(); if ($result && mysql_num_rows($result) > 0) { while ($line = mysql_fetch_assoc($result)) { $period = new PayPeriod(); $period->setCode($line[self::DB_FIELD_PAYPERIOD_CODE]); $period->setName($line[self::DB_FIELD_PAYPERIOD_NAME]); $periods[$period->getCode()] = $period; } } return $periods; }