activity_model.php
11 months ago
agent_meta_model.php
1 year ago
agent_model.php
1 year ago
booking_meta_model.php
1 year ago
booking_model.php
11 months ago
bundle_meta_model.php
11 months ago
bundle_model.php
11 months ago
cart_item_model.php
1 year ago
cart_meta_model.php
1 year ago
cart_model.php
1 year ago
connector_model.php
1 year ago
customer_meta_model.php
1 year ago
customer_model.php
9 months ago
invoice_model.php
1 year ago
join_bundles_services_model.php
1 year ago
location_category_model.php
9 months ago
location_model.php
1 year ago
meta_model.php
1 year ago
model.php
9 months ago
off_period_model.php
1 year ago
order_intent_meta_model.php
1 year ago
order_intent_model.php
9 months ago
order_item_model.php
1 year ago
order_meta_model.php
1 year ago
order_model.php
11 months ago
otp_model.php
9 months ago
payment_request_model.php
1 year ago
process_job_model.php
1 year ago
process_model.php
1 year ago
recurrence_model.php
1 year ago
service_category_model.php
9 months ago
service_meta_model.php
1 year ago
service_model.php
9 months ago
session_model.php
1 year ago
settings_model.php
1 year ago
step_settings_model.php
1 year ago
transaction_intent_model.php
1 year ago
transaction_model.php
1 year ago
transaction_refund_model.php
1 year ago
work_period_model.php
1 year ago
step_settings_model.php
55 lines
| 1 | <?php |
| 2 | |
| 3 | class OsStepSettingsModel extends OsModel{ |
| 4 | var $id, |
| 5 | $name, |
| 6 | $value, |
| 7 | $step; |
| 8 | |
| 9 | |
| 10 | function __construct($id = false){ |
| 11 | parent::__construct(); |
| 12 | $this->table_name = LATEPOINT_TABLE_STEP_SETTINGS; |
| 13 | $this->nice_names = array(); |
| 14 | |
| 15 | if($id){ |
| 16 | $this->load_by_id($id); |
| 17 | } |
| 18 | } |
| 19 | |
| 20 | |
| 21 | public function get_step_value_by_name($step, $name){ |
| 22 | $query = $this->db->prepare('SELECT * FROM '.$this->table_name.' WHERE name = %s AND step = %s LIMIT 1', array($name, $step)); |
| 23 | $result_row = $this->db->get_row( $query, ARRAY_A); |
| 24 | if($result_row){ |
| 25 | return $result_row['value']; |
| 26 | }else{ |
| 27 | return false; |
| 28 | } |
| 29 | } |
| 30 | |
| 31 | |
| 32 | protected function allowed_params($role = 'admin'){ |
| 33 | $allowed_params = array('name', |
| 34 | 'value', |
| 35 | 'step'); |
| 36 | return $allowed_params; |
| 37 | } |
| 38 | |
| 39 | |
| 40 | protected function params_to_save($role = 'admin'){ |
| 41 | $params_to_save = array('name', |
| 42 | 'value', |
| 43 | 'step'); |
| 44 | return $params_to_save; |
| 45 | } |
| 46 | |
| 47 | protected function properties_to_validate(){ |
| 48 | $validations = array( |
| 49 | 'name' => array('presence'), |
| 50 | 'value' => array('presence'), |
| 51 | 'step' => array('presence'), |
| 52 | ); |
| 53 | return $validations; |
| 54 | } |
| 55 | } |