public static function run() { $action = array_key_exists('action', $_SESSION) ? $_SESSION['action'] : ""; $arguments = array_key_exists('arguments', $_SESSION) ? $_SESSION['arguments'] : ""; switch ($action) { case "create": self::newUserData(); break; case "show": if ($arguments == 'all') { $_SESSION['userData'] = UserDataDB::getUserDataBy(); $_SESSION['headertitle'] = "botspace user data"; UserDataView::showAll(); } else { $userData = UserDataDB::getUserDataBy('userDataId', $arguments); $_SESSION['userData'] = $userData[0]; self::show(); } break; case "update": echo "Update"; self::updateUserData(); break; default: } }
public static function run() { $action = array_key_exists('action', $_SESSION) ? $_SESSION['action'] : ""; $arguments = array_key_exists('arguments', $_SESSION) ? $_SESSION['arguments'] : ""; switch ($action) { case "create": self::newUserData(); break; // FIXME: $_SESSION['userData'] can refer to either a single object // or an array of objects. Give them separate keys // FIXME: $_SESSION['userData'] can refer to either a single object // or an array of objects. Give them separate keys case "show": if ($arguments == 'all') { $_SESSION['userData'] = UserDataDB::getUserDataBy(); $_SESSION['headertitle'] = "botspace user data"; UserDataView::showAll(); } else { $userData = UserDataDB::getUserDataBy('userDataId', $arguments); $_SESSION['userData'] = $userData[0]; self::show(); } break; case "update": //echo "Update"; self::updateUserData(); break; default: } }