Deprecate book_wash_f methods with exception messages

- Added deprecation exceptions in `beforeSave` to guide users to the new booking page and updated booking object usage.
This commit is contained in:
Jeppe Bundgaard
2025-11-25 15:27:56 +01:00
parent 3dba2dedac
commit 7e9c456074
@@ -41,6 +41,7 @@ class book_wash_f extends form_helper_c
*/
public function beforeSave(): void
{
throw new \Exception('Deprecated: Please refresh the page, and use the new booking page instead.');
// Set the department id to the department id of the user
self::setDepartmentId(self::getSanitizedData('department_id'));
// Set the customer number to the customer number of the user
@@ -61,6 +62,7 @@ class book_wash_f extends form_helper_c
$department = (new departments_o())->selectId((int)self::getSanitizedData('department_id'));
$department->getObjectProperties();
// Get the bookings_new object
throw new \Exception('Deprecated: Use bookings_o instead of bookings_new_o');
$bookings = new bookings_o();
// Check if the wash type contains the interior wash
$wants_wash_certificate = (bool)self::getSanitizedData('wants_wash_certificate');