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
1 week ago
bundle_meta_model.php
3 months ago
bundle_model.php
1 week ago
cart_item_model.php
3 months ago
cart_meta_model.php
3 months ago
cart_model.php
2 weeks ago
connector_model.php
3 months ago
customer_meta_model.php
3 months ago
customer_model.php
1 month ago
invoice_model.php
2 weeks 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
1 week ago
order_item_model.php
3 months ago
order_meta_model.php
3 months ago
order_model.php
1 month ago
otp_model.php
3 months ago
payment_request_model.php
3 months ago
process_job_model.php
3 months ago
process_model.php
1 month 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
connector_model.php
62 lines
| 1 | <?php |
| 2 | |
| 3 | class OsConnectorModel extends OsModel { |
| 4 | public $id, |
| 5 | $agent_id, |
| 6 | $service_id, |
| 7 | $location_id, |
| 8 | $is_custom_price = false, |
| 9 | $is_custom_hours = false, |
| 10 | $is_custom_duration = false, |
| 11 | $updated_at, |
| 12 | $created_at; |
| 13 | |
| 14 | function __construct( $id = false ) { |
| 15 | parent::__construct(); |
| 16 | $this->table_name = LATEPOINT_TABLE_AGENTS_SERVICES; |
| 17 | $this->nice_names = array(); |
| 18 | |
| 19 | if ( $id ) { |
| 20 | $this->load_by_id( $id ); |
| 21 | } |
| 22 | } |
| 23 | |
| 24 | |
| 25 | |
| 26 | protected function params_to_save( $role = 'admin' ) { |
| 27 | $params_to_save = array( |
| 28 | 'id', |
| 29 | 'agent_id', |
| 30 | 'service_id', |
| 31 | 'location_id', |
| 32 | 'is_custom_price', |
| 33 | 'is_custom_hours', |
| 34 | 'is_custom_duration', |
| 35 | ); |
| 36 | return $params_to_save; |
| 37 | } |
| 38 | |
| 39 | protected function allowed_params( $role = 'admin' ) { |
| 40 | $allowed_params = array( |
| 41 | 'id', |
| 42 | 'agent_id', |
| 43 | 'service_id', |
| 44 | 'location_id', |
| 45 | 'is_custom_price', |
| 46 | 'is_custom_hours', |
| 47 | 'is_custom_duration', |
| 48 | ); |
| 49 | return $allowed_params; |
| 50 | } |
| 51 | |
| 52 | |
| 53 | protected function properties_to_validate() { |
| 54 | $validations = array( |
| 55 | 'agent_id' => array( 'presence' ), |
| 56 | 'service_id' => array( 'presence' ), |
| 57 | 'location_id' => array( 'presence' ), |
| 58 | ); |
| 59 | return $validations; |
| 60 | } |
| 61 | } |
| 62 |