public function fetchRgProductsAction() { $fsa_status = $this->getRequest()->getParam('fsa_status'); $letType = $this->getRequest()->getParam('letType'); $howRgOffered = $this->getRequest()->getParam('howRgOffered'); $isCompanyApplication = $this->getRequest()->getParam('isCompanyApplication'); $manager = new Manager_Core_RGProductOffered(); $productJson = $manager->fetchProducts($fsa_status, $letType, $howRgOffered); //Ensure that set of possible products includes only Enhance, Extra and Advantage. $returnArray = array(); foreach ($productJson as $currentProduct) { if (preg_match("/^9\$|^10\$|^21\$/", $currentProduct['value'])) { $returnArray[] = array('value' => $currentProduct['value'], 'name' => $currentProduct['name']); } } echo json_encode($returnArray); }
/** * Fetches all products * * @param string $fsa_status * @param int $letType * @param int $howRgOffered * @return array products data */ public function fetchProducts($fsa_status, $letType, $howRgOffered) { $rgp_offered = new Manager_Core_RGProductOffered(); return $rgp_offered->fetchProducts($fsa_status, $letType, $howRgOffered); }