function getByCompanyIdArray($company_id, $include_blank = TRUE) { $mplf = new BreakPolicyListFactory(); $mplf->getByCompanyId($company_id); if ($include_blank == TRUE) { $list[0] = '--'; } foreach ($mplf as $mp_obj) { $list[$mp_obj->getID()] = $mp_obj->getName(); } if (isset($list)) { return $list; } return FALSE; }
} $bplf = new BreakPolicyListFactory(); foreach ($ids as $id) { $bplf->getByIdAndCompanyId($id, $current_company->getId()); foreach ($bplf as $bp_obj) { $bp_obj->setDeleted($delete); if ($bp_obj->isValid()) { $bp_obj->Save(); } } } Redirect::Page(URLBuilder::getURL(NULL, 'BreakPolicyList.php')); break; default: $bplf = new BreakPolicyListFactory(); $bplf->getByCompanyId($current_company->getId()); $pager = new Pager($bplf); $type_options = $bplf->getOptions('type'); $show_no_policy_group_notice = FALSE; foreach ($bplf as $bp_obj) { if ((int) $bp_obj->getColumn('assigned_policy_groups') == 0) { $show_no_policy_group_notice = TRUE; } $policies[] = array('id' => $bp_obj->getId(), 'name' => $bp_obj->getName(), 'type_id' => $bp_obj->getType(), 'type' => $type_options[$bp_obj->getType()], 'amount' => $bp_obj->getAmount(), 'trigger_time' => $bp_obj->getTriggerTime(), 'assigned_policy_groups' => (int) $bp_obj->getColumn('assigned_policy_groups'), 'deleted' => $bp_obj->getDeleted()); } $smarty->assign_by_ref('policies', $policies); $smarty->assign_by_ref('show_no_policy_group_notice', $show_no_policy_group_notice); $smarty->assign_by_ref('sort_column', $sort_column); $smarty->assign_by_ref('sort_order', $sort_order); $smarty->assign_by_ref('paging_data', $pager->getPageVariables()); break;