Ejemplo n.º 1
0
 public static function add_new_scope_under_specific_meaning($termUID, $meaningUID, $user, $scope_text = '', $scope_desc)
 {
     // create new scope
     $new_scope = scope::add_new_scope($scope_text, $scope_desc, $user);
     if ($new_scope == null) {
         debugLog::debug_log("could not create the scope \"" . $scope_text . "\", \"" . $scope_desc . "\"");
         return null;
     }
     // add new connection record to TERMS table that creates relation between scope, term and meaning
     $dbObj = new dbAPI();
     // get new UID
     $UID = $dbObj->get_latest_UID($dbObj->db_get_contentDB(), 'TERMS');
     $UID++;
     // add record to database
     $query = "INSERT INTO TERMS (UID, ID_TERM_MEAN, ID_SCOPE, ID_TERM_STRING, ENABLED, USER_ID, CREATION_DATE) VALUES (" . $UID . ", '" . $meaningUID . "', '" . $new_scope["UID"] . "', '" . $termUID . "', 1, " . $user . ",'" . date("Y-m-d H:i:s") . "')";
     $dbObj->run_query($dbObj->db_get_contentDB(), $query);
     // returns an entity of recently added connection
     return term::get_connection_by_UID($UID);
 }