/** * Adds new instance of Delivery's front to the specific front table based on FRONT_TYPE in edit mode(to users database) * @param {int} $UID The UID of the base Delivery * @param {frontDelivery} $front array of key value pair in FRONT format * @param {int} $user User id of the creator * @return {frontDelivery} */ private static function add_new_front($UID, $front, $user) { $dbObj = new dbAPI(); $front_type = $front["FRONT_TYPE"]; if ($front_type == null) { debugLog::log("<i>[delivery.php:add_new_front]</i> FRONT Delivery type of (" . $UID . ") is missing!"); return null; } // determine which front Delivery insertion function should be called switch ($front_type) { case "DELIVERY_FRONT": $Delivery_front = Delivery::add_new_Delivery_FRONT($UID, $front, $user); if ($Delivery_front == null) { debugLog::log("<i>[delivery.php:add_new_front]</i> Could not insert a new front Delivery of the base (" . $UID . "), [add_new_Delivery_FRONT] faild"); return null; } return $Delivery_front; break; case "YOUTUBE": // example for future formats debugLog::log("<i>[delivery.php:add_new_front]</i> Dummy format was invoked (YOUTUBE)"); return null; default: debugLog::log("<i>[delivery.php:add_new_front]</i> Default case was invoked [UID]:(" . $UID . ")"); return null; } }