function get_linked_records($get_module, $from_module, $get_id) { // instantiate and retrieve $from_module $from_mod = BeanFactory::getBean($from_module, $get_id); $field = get_module_link_field($from_module, $get_module); if ($field === FALSE) { return FALSE; } $from_mod->load_relationship($field); $id_arr = $from_mod->{$field}->get(); //bug: 38065 if ($get_module == 'EmailAddresses') { $emails = $from_mod->emailAddress->addresses; $email_arr = array(); foreach ($emails as $email) { $email_arr[] = $email['email_address_id']; } return $email_arr; } return $id_arr; }
function get_linked_records($get_module, $from_module, $get_id) { global $beanList, $beanFiles; // instantiate and retrieve $from_module $from_class = $beanList[$from_module]; require_once $beanFiles[$from_class]; $from_mod = new $from_class(); $from_mod->retrieve($get_id); $field = get_module_link_field($from_module, $get_module); if ($field === FALSE) { return FALSE; } $from_mod->load_relationship($field); $id_arr = $from_mod->{$field}->get(); return $id_arr; }
function get_linked_records($get_module, $from_module, $get_id) { global $beanList, $beanFiles; // instantiate and retrieve $from_module $from_class = $beanList[$from_module]; require_once $beanFiles[$from_class]; $from_mod = new $from_class(); $from_mod->retrieve($get_id); $field = get_module_link_field($from_module, $get_module); if ($field === FALSE) { return FALSE; } $from_mod->load_relationship($field); $id_arr = $from_mod->{$field}->get(); //bug: 38065 if ($get_module == 'EmailAddresses') { $emails = $from_mod->emailAddress->addresses; $email_arr = array(); foreach ($emails as $email) { $email_arr[] = $email['email_address_id']; } return $email_arr; } return $id_arr; }