Ejemplo n.º 1
0
 public static function parseDeleteData($postArr)
 {
     $payPeriods = array();
     if (is_array($postArr['chkPayPeriodId'])) {
         for ($i = 0; $i < count($postArr['chkPayPeriodId']); $i++) {
             $tmpObj = new HspPayPeriod();
             $tmpObj->setId($postArr['chkPayPeriodId'][$i]);
             $payPeriods[] = $tmpObj;
         }
     }
     return $payPeriods;
 }
Ejemplo n.º 2
0
 public function testDelete()
 {
     $payPeriod = new HspPayPeriod();
     $payPeriod->setId(1);
     $payPeriod->delete();
     $payPeriods = HspPayPeriod::listPayPeriods(date('Y'));
     $this->assertTrue(is_array($payPeriods));
     $this->assertEquals(0, count($payPeriods));
 }
Ejemplo n.º 3
0
 private static function _buildObjArr($result)
 {
     $objArr = array();
     while ($row = mysql_fetch_assoc($result)) {
         $tmpArr = new HspPayPeriod();
         $tmpArr->setId($row[self::PAY_PERIOD_DB_FIELD_ID]);
         $tmpArr->setStartDate($row[self::PAY_PERIOD_DB_FIELD_START_DATE]);
         $tmpArr->setEndDate($row[self::PAY_PERIOD_DB_FIELD_END_DATE]);
         $tmpArr->setCloseDate($row[self::PAY_PERIOD_DB_FIELD_CLOSE_DATE]);
         $tmpArr->setCheckDate($row[self::PAY_PERIOD_DB_FIELD_CHECK_DATE]);
         $tmpArr->setTimesheetAprovalDueDate($row[self::PAY_PERIOD_DB_FIELD_TIMESHEET_APROVAL_DUE_DATE]);
         $objArr[] = $tmpArr;
     }
     return $objArr;
 }