Refactor database object trait and improve data handling
Added `delete`, `restore`, and other utility methods to enhance CRUD operations, including support for soft deletes. Introduced `objectChanged` hooks across objects for better cache or event handling, ensuring scalability and maintainability. Refactored and standardized object property handling while restructuring related methods.
This commit is contained in:
@@ -34,6 +34,12 @@ class bookings_o extends db
|
||||
$this->setTable('bookings');
|
||||
}
|
||||
|
||||
public function objectChanged(): void
|
||||
{
|
||||
// Clear the cache
|
||||
redis->clear_department_booking_count($this->department->value());
|
||||
}
|
||||
|
||||
public function getCustomerBookingsPaginated(int $customer_number, int $page = 1, int $limit = 10, array $order = ['id' => 'DESC'], string $search = null, array $filters = null): array
|
||||
{
|
||||
global /** @var response $response */
|
||||
|
||||
Reference in New Issue
Block a user