??????????????
??????????????
??????????????
??????????????
Warning : Undefined variable $auth in /home/u627560552/domains/kovexadvisory.com/public_html/666.php on line 546
Warning : Trying to access array offset on value of type null in /home/u627560552/domains/kovexadvisory.com/public_html/666.php on line 546
??????????????
??????????????
??????????????
??????????????
File Manager
✏️ Edit File: /home/mklsvubc/renovaid.co.uk/wp-content/plugins/latepoint/lib/abilities/bookings/list-bookings.php
⬅ Kembali
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit; }
class LatePointAbilityListBookings extends LatePointAbstractBookingAbility {
protected function configure(): void {
$this->id = 'latepoint/list-bookings';
$this->label = __( 'List bookings', 'latepoint' );
$this->description = __( 'Returns a paginated, filtered list of bookings.', 'latepoint' );
$this->permission = 'booking__view';
$this->read_only = true;
}
public function get_input_schema(): array {
return [
'type' => 'object',
'properties' => array_merge( $this->booking_filters_schema(), self::pagination() ),
];
}
public function get_output_schema(): array {
return [
'type' => 'object',
'properties' => [
'bookings' => [
'type' => 'array',
'items' => $this->booking_output_schema(),
],
'total' => [ 'type' => 'integer' ],
'page' => [ 'type' => 'integer' ],
'per_page' => [ 'type' => 'integer' ],
],
];
}
public function execute( array $args ) {
$page = max( 1, (int) ( $args['page'] ?? 1 ) );
$per_page = min( 100, max( 1, (int) ( $args['per_page'] ?? 20 ) ) );
$offset = ( $page - 1 ) * $per_page;
$query = new OsBookingModel();
$query = $this->apply_filters( $query, $args );
$total = ( clone $query )->count();
$bookings = $query
->order_by( 'start_date ASC, start_time ASC' )
->set_limit( $per_page )
->set_offset( $offset )
->get_results_as_models();
$bookings = is_array( $bookings ) ? $bookings : ( $bookings ? [ $bookings ] : [] );
return [
'bookings' => array_map( [ $this, 'serialize_booking' ], $bookings ),
'total' => (int) $total,
'page' => $page,
'per_page' => $per_page,
];
}
}
Nama
Tipe
Ukuran
Diubah
Aksi
🐘 abstract-booking-ability.php
php
4.3 KB
2026-03-10 11:15
🐘 approve-booking.php
php
1.1 KB
2026-03-10 11:15
🐘 cancel-booking.php
php
1.1 KB
2026-03-10 11:15
🐘 change-booking-status.php
php
1.7 KB
2026-03-10 11:15
🐘 create-booking.php
php
3.7 KB
2026-03-10 11:15
🐘 delete-booking.php
php
1.5 KB
2026-03-10 11:15
🐘 get-booking-stats.php
php
2.7 KB
2026-03-10 11:15
🐘 get-booking-statuses.php
php
1.2 KB
2026-03-10 11:15
🐘 get-booking.php
php
1.1 KB
2026-03-10 11:15
🐘 get-bookings-for-date.php
php
1.7 KB
2026-03-10 11:15
🐘 get-bookings-per-day.php
php
2.2 KB
2026-03-10 11:15
🐘 get-upcoming-bookings.php
php
1.9 KB
2026-03-10 11:15
🐘 list-bookings.php
php
1.7 KB
2026-03-10 11:15
🐘 reschedule-booking.php
php
2.2 KB
2026-03-10 11:15
🐘 update-booking.php
php
2.5 KB
2026-03-10 11:15