public static function getTableInstance() { if (!self::$_table) { self::$_table = new Model_Table_Ports(); } return self::$_table; }
public function getIecDetailsByIecId($iec_id) { $iec_info = Model_EntityIecinfo::getEntityInfobyId($iec_id)->toArray(); $category = Model_EntityCategories::getCategoryById($iec_info['category'])->toArray(); $iec_info['category_name'] = $category['name']; $iec_info['bank_details'] = Model_EntityBankDetails::getBankDetailsByIecId($iec_id)->toArray(); $iec_details = Model_EntityDetails::getIecDetailsByIecId($iec_id)->toArray(); $iec_info['ports'] = Model_Ports::getAllPorts()->toArray(); $iec_info['capital_goods'] = Model_EpcgGoodsSector::getAllGoodsSector()->toArray(); //$primary_branch_flag = false; foreach ($iec_details as $detail) { $detail['state'] = Model_States::getById($detail['state'])->toArray()['name']; $detail['district'] = Model_Districts::getById($detail['district'])->toArray()['name']; $detail['city'] = Model_Cities::getById($detail['city'])->toArray()['name']; if ($detail['entity_category_id'] == 0) { if ($detail['state'] == 'Karnataka') { //TO DO: Pick state Karnataka from database $iec_info['branch_details_primary'][] = $detail; //$primary_branch_flag = true; } $iec_info['branch_details'][] = $detail; } else { $iec_info['partner_details'][] = $detail; } } print_r($iec_info); return $iec_info; }