private static function insertNewIdsAction($actionsNameAndType, $fieldNamesToInsert) { // Then, we insert all new actions in the lookup table $inserted = array(); foreach ($fieldNamesToInsert as $fieldName) { list($name, $type, $urlPrefix) = $actionsNameAndType[$fieldName]; $actionId = self::getModel()->createNewIdAction($name, $type, $urlPrefix); Common::printDebug("Recorded a new action (" . Action::getTypeAsString($type) . ") in the lookup table: " . $name . " (idaction = " . $actionId . ")"); $inserted[$fieldName] = $actionId; } return $inserted; }
private static function insertNewIdsAction($actionsNameAndType, $fieldNamesToInsert) { $sql = "INSERT INTO " . Common::prefixTable('log_action') . "( name, hash, type, url_prefix ) VALUES (?,CRC32(?),?,?)"; // Then, we insert all new actions in the lookup table $inserted = array(); foreach ($fieldNamesToInsert as $fieldName) { list($name, $type, $urlPrefix) = $actionsNameAndType[$fieldName]; Tracker::getDatabase()->query($sql, array($name, $name, $type, $urlPrefix)); $actionId = Tracker::getDatabase()->lastInsertId(); $inserted[$fieldName] = $actionId; Common::printDebug("Recorded a new action (" . Action::getTypeAsString($type) . ") in the lookup table: " . $name . " (idaction = " . $actionId . ")"); } return $inserted; }