if (isset($data['start_date'])) {
     $cdf->setStartDate($data['start_date']);
 }
 if (isset($data['end_date'])) {
     $cdf->setEndDate($data['end_date']);
 }
 if (isset($data['minimum_length_of_service'])) {
     $cdf->setMinimumLengthOfService($data['minimum_length_of_service']);
     $cdf->setMinimumLengthOfServiceUnit($data['minimum_length_of_service_unit_id']);
 }
 if (isset($data['maximum_length_of_service'])) {
     $cdf->setMaximumLengthOfService($data['maximum_length_of_service']);
     $cdf->setMaximumLengthOfServiceUnit($data['maximum_length_of_service_unit_id']);
 }
 if (isset($data['include_account_amount_type_id'])) {
     $cdf->setIncludeAccountAmountType($data['include_account_amount_type_id']);
 }
 if (isset($data['exclude_account_amount_type_id'])) {
     $cdf->setExcludeAccountAmountType($data['exclude_account_amount_type_id']);
 }
 if ($cdf->isValid()) {
     $cdf->Save(FALSE);
     if (isset($data['include_pay_stub_entry_account_ids'])) {
         $cdf->setIncludePayStubEntryAccount($data['include_pay_stub_entry_account_ids']);
     } else {
         $cdf->setIncludePayStubEntryAccount(array());
     }
     if (isset($data['exclude_pay_stub_entry_account_ids'])) {
         $cdf->setExcludePayStubEntryAccount($data['exclude_pay_stub_entry_account_ids']);
     } else {
         $cdf->setExcludePayStubEntryAccount(array());