public static function get_scope_by_UID_with_relations($UID, $lang = '') { // check if scope exists $Scope = scope::get_scope_by_UID($UID); if ($Scope == null) { return null; } // add related scopes to scope object $Scope["RELATED_SCOPES"] = scope::get_relations_of_scope($UID); $Scope["TERMS"] = scope::get_terms_of_scope($UID, $lang); return $Scope; }
public static function get_scopes_of_term($term_UID, $lang = '') { $scopes = array(); // extract scope terms relations $dbObj = new dbAPI(); $query = "SELECT * FROM TERMS where ENABLED = 1 AND ( ID_TERM_STRING = " . $term_UID . ")"; $scopes_related = $dbObj->db_select_query($dbObj->db_get_contentDB(), $query); if ($scopes_related == null) { return null; } // get scopes and meanings details for ($i = 0; $i < count($scopes_related); $i++) { $curr_scope = scope::get_scope_by_UID($scopes_related[$i]["ID_SCOPE"], $lang); $curr_meaning = term::get_term_meaning_by_UID($scopes_related[$i]["ID_TERM_MEAN"], $lang); if ($curr_scope != null) { array_push($scopes, array('scope' => $curr_scope, 'meaning' => $curr_meaning)); } } return $scopes; }