function get_mspr_entity($type, $entity_id) { switch ($type) { case 'studentships': $entity = Studentship::get($entity_id); break; case 'clineval': $entity = ClinicalPerformanceEvaluation::get($entity_id); break; case 'internal_awards': $entity = InternalAwardReceipt::get($entity_id); break; case 'external_awards': $entity = ExternalAwardReceipt::get($entity_id); break; case 'contributions': $entity = Contribution::get($entity_id); break; case 'student_run_electives': $entity = StudentRunElective::get($entity_id); break; case 'observerships': $entity = Observership::get($entity_id); break; case 'int_acts': $entity = InternationalActivity::get($entity_id); break; case 'critical_enquiry': $entity = CriticalEnquiry::get($entity_id); break; case 'community_based_project': $entity = CommunityBasedProject::get($entity_id); break; case 'research_citations': $entity = ResearchCitation::get($entity_id); break; } return $entity; }