/** * Add new Delivery in edit mode (users database) * @param {string} $title The title of the Delivery * @param {string} $desc The description of the Delivery * @param {int} $user The user's id who added the Delivery * @param {frontDelivery} $front array of key value pair in FRONT format * @return {Delivery} */ public static function add_new_Delivery_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(), 'DELIVERY_BASE'); $UID++; // try to acquire lock on the Delivery if (Lock::acquire_lock($UID, 'DELIVERY_BASE', $user) == false) { debugLog::log("<i>[delivery.php:add_new_Delivery_in_edit_mode]</i> Could not acquire lock on Delivery (" . $UID . "), check whether the Delivery is locked by other users"); return null; } return Delivery::add_new_edit_for_Delivery($UID, $title, $desc, $user, $front); }