??????????????
??????????????
??????????????
??????????????
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/services/get-services.php
⬅ Kembali
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
class LatePointAbilityGetServices extends LatePointAbstractServiceAbility {
protected function configure(): void {
$this->id = 'latepoint/get-services';
$this->label = __( 'Get services', 'latepoint' );
$this->description = __( 'Returns all services, optionally filtered by status.', 'latepoint' );
$this->permission = 'service__view';
$this->read_only = true;
}
public function get_input_schema(): array {
return [
'type' => 'object',
'properties' => [
'status' => [
'type' => 'string',
'enum' => [ 'active', 'disabled' ],
'description' => __( 'Filter by status.', 'latepoint' ),
],
'category_id' => [
'type' => 'integer',
'description' => __( 'Filter by category ID.', 'latepoint' ),
],
],
];
}
public function get_output_schema(): array {
return [
'type' => 'object',
'properties' => [
'services' => [
'type' => 'array',
'items' => $this->service_output_schema(),
],
'total' => [ 'type' => 'integer' ],
],
];
}
public function execute( array $args ) {
$query = new OsServiceModel();
if ( ! empty( $args['status'] ) ) {
$query->where( [ 'status' => sanitize_text_field( $args['status'] ) ] );
}
if ( ! empty( $args['category_id'] ) ) {
$query->where( [ 'category_id' => (int) $args['category_id'] ] );
}
$services = $query->order_by( 'order_number ASC, name ASC' )->get_results_as_models();
return [
'services' => array_map( [ $this, 'serialize_service' ], $services ),
'total' => count( $services ),
];
}
}
Nama
Tipe
Ukuran
Diubah
Aksi
🐘 abstract-service-ability.php
php
1.7 KB
2026-03-10 11:15
🐘 create-service.php
php
2.7 KB
2026-03-10 11:15
🐘 delete-service.php
php
1.5 KB
2026-03-10 11:15
🐘 disable-service.php
php
1.4 KB
2026-03-10 11:15
🐘 duplicate-service.php
php
2.2 KB
2026-03-10 11:15
🐘 enable-service.php
php
1.4 KB
2026-03-10 11:15
🐘 get-service-agents.php
php
2.1 KB
2026-03-10 11:15
🐘 get-service-bookings.php
php
3.3 KB
2026-03-10 11:15
🐘 get-service.php
php
1.1 KB
2026-03-10 11:15
🐘 get-services.php
php
1.6 KB
2026-03-10 11:15
🐘 list-service-categories.php
php
1.2 KB
2026-03-10 11:15
🐘 update-service.php
php
2.6 KB
2026-03-10 11:15