Ejemplo n.º 1
0
 /**
  * Add new Kbit in edit mode (users database)
  * @param {string} $title The title of the Kbit
  * @param {string} $desc  The description of the Kbit
  * @param {int} $user  The user's id who added the Kbit
  * @param {frontKbit} $front array of key value pair in FRONT format
  * @return {Kbit}
  */
 public static function add_new_Kbit_in_edit_mode($title, $desc, $user, $front)
 {
     $dbObj = new dbAPI();
     // get new UID from contents database to reseve the UID
     $UID = $dbObj->get_latest_UID($dbObj->db_get_contentDB(), 'KBIT_BASE');
     $UID++;
     // try to acquire lock on the Kbit
     if (Lock::acquire_lock($UID, 'KBIT_BASE', $user) == false) {
         debugLog::log("<i>[Kbits.php:add_new_Kbit_in_edit_mode]</i> Could not acquire lock on kbit (" . $UID . "), check whether the Kbit is locked by other users");
         return null;
     }
     return Kbit::add_new_edit_for_kbit($UID, $title, $desc, $user, $front);
 }