activity_model.php
3 months ago
agent_meta_model.php
3 months ago
agent_model.php
3 months ago
booking_meta_model.php
3 months ago
booking_model.php
3 months ago
bundle_meta_model.php
3 months ago
bundle_model.php
3 months ago
cart_item_model.php
3 months ago
cart_meta_model.php
3 months ago
cart_model.php
3 months ago
connector_model.php
3 months ago
customer_meta_model.php
3 months ago
customer_model.php
3 months ago
invoice_model.php
3 months ago
join_bundles_services_model.php
3 months ago
location_category_model.php
3 months ago
location_model.php
3 months ago
meta_model.php
3 months ago
model.php
3 months ago
off_period_model.php
3 months ago
order_intent_meta_model.php
3 months ago
order_intent_model.php
3 months ago
order_item_model.php
3 months ago
order_meta_model.php
3 months ago
order_model.php
3 months ago
otp_model.php
3 months ago
payment_request_model.php
3 months ago
process_job_model.php
3 months ago
process_model.php
3 months ago
recurrence_model.php
3 months ago
service_category_model.php
3 months ago
service_meta_model.php
3 months ago
service_model.php
3 months ago
session_model.php
3 months ago
settings_model.php
3 months ago
step_settings_model.php
3 months ago
transaction_intent_model.php
3 months ago
transaction_model.php
3 months ago
transaction_refund_model.php
3 months ago
work_period_model.php
3 months ago
join_bundles_services_model.php
60 lines
| 1 | <?php |
| 2 | /* |
| 3 | * Copyright (c) 2023 LatePoint LLC. All rights reserved. |
| 4 | */ |
| 5 | |
| 6 | class OsJoinBundlesServicesModel extends OsModel { |
| 7 | |
| 8 | var $id, |
| 9 | $bundle_id, |
| 10 | $total_attendees, |
| 11 | $duration, |
| 12 | $service_id, |
| 13 | $quantity, |
| 14 | $updated_at, |
| 15 | $created_at; |
| 16 | |
| 17 | function __construct( $id = false ) { |
| 18 | parent::__construct(); |
| 19 | $this->table_name = LATEPOINT_TABLE_JOIN_BUNDLES_SERVICES; |
| 20 | |
| 21 | if ( $id ) { |
| 22 | $this->load_by_id( $id ); |
| 23 | } |
| 24 | } |
| 25 | |
| 26 | function get_services_for_bundle_id( $bundle_id ) { |
| 27 | return $this->where( [ 'bundle_id' => $bundle_id ] )->get_results_as_models(); |
| 28 | } |
| 29 | |
| 30 | |
| 31 | protected function allowed_params( $role = 'admin' ) { |
| 32 | $allowed_params = array( |
| 33 | 'id', |
| 34 | 'bundle_id', |
| 35 | 'service_id', |
| 36 | 'total_attendees', |
| 37 | 'duration', |
| 38 | 'quantity', |
| 39 | 'updated_at', |
| 40 | 'created_at', |
| 41 | ); |
| 42 | return $allowed_params; |
| 43 | } |
| 44 | |
| 45 | |
| 46 | protected function params_to_save( $role = 'admin' ) { |
| 47 | $params_to_save = array( |
| 48 | 'id', |
| 49 | 'bundle_id', |
| 50 | 'service_id', |
| 51 | 'total_attendees', |
| 52 | 'duration', |
| 53 | 'quantity', |
| 54 | 'updated_at', |
| 55 | 'created_at', |
| 56 | ); |
| 57 | return $params_to_save; |
| 58 | } |
| 59 | } |
| 60 |