function setPayPeriod($id)
 {
     $id = trim($id);
     $pplf = new PayPeriodListFactory();
     if ($this->Validator->isResultSetWithRows('pay_period', $pplf->getByID($id), TTi18n::gettext('Invalid Pay Period'))) {
         $this->data['pay_period_id'] = $id;
         return TRUE;
     }
     return FALSE;
 }
 function setPayPeriod($id = NULL)
 {
     $id = trim($id);
     if ($id == NULL) {
         $id = $this->findPayPeriod();
     }
     $pplf = new PayPeriodListFactory();
     //Allow NULL pay period, incase its an absence or something in the future.
     //Cron will fill in the pay period later.
     if ($id == FALSE or $this->Validator->isResultSetWithRows('pay_period', $pplf->getByID($id), TTi18n::gettext('Invalid Pay Period'))) {
         $this->data['pay_period_id'] = $id;
         return TRUE;
     }
     return FALSE;
 }