activity_model.php
1 year ago
agent_meta_model.php
1 year ago
agent_model.php
1 year ago
booking_meta_model.php
1 year ago
booking_model.php
1 year ago
bundle_model.php
1 year 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
1 year ago
invoice_model.php
1 year ago
join_bundles_services_model.php
1 year ago
location_category_model.php
1 year ago
location_model.php
1 year ago
meta_model.php
1 year ago
model.php
1 year ago
order_intent_meta_model.php
1 year ago
order_intent_model.php
1 year ago
order_item_model.php
1 year ago
order_meta_model.php
1 year ago
order_model.php
1 year ago
payment_request_model.php
1 year ago
process_job_model.php
1 year ago
process_model.php
1 year ago
service_category_model.php
1 year ago
service_meta_model.php
1 year ago
service_model.php
1 year 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
settings_model.php
49 lines
| 1 | <?php |
| 2 | |
| 3 | class OsSettingsModel extends OsModel{ |
| 4 | var $id, |
| 5 | $name, |
| 6 | $value, |
| 7 | $created_at, |
| 8 | $updated_at; |
| 9 | |
| 10 | |
| 11 | function __construct($id = false){ |
| 12 | parent::__construct(); |
| 13 | $this->table_name = LATEPOINT_TABLE_SETTINGS; |
| 14 | $this->nice_names = array(); |
| 15 | |
| 16 | if($id){ |
| 17 | $this->load_by_id($id); |
| 18 | } |
| 19 | } |
| 20 | |
| 21 | public function load_by_name($name){ |
| 22 | $setting = $this->where(array('name' => $name))->set_limit(1)->get_results_as_models(); |
| 23 | if($setting){ |
| 24 | $this->id = $setting->id; |
| 25 | $this->set_data($setting); |
| 26 | } |
| 27 | return $this; |
| 28 | } |
| 29 | |
| 30 | |
| 31 | protected function allowed_params($role = 'admin'){ |
| 32 | $allowed_params = array('name', |
| 33 | 'value'); |
| 34 | return $allowed_params; |
| 35 | } |
| 36 | |
| 37 | protected function params_to_save($role = 'admin'){ |
| 38 | $params_to_save = array('name', |
| 39 | 'value'); |
| 40 | return $params_to_save; |
| 41 | } |
| 42 | |
| 43 | protected function properties_to_validate(){ |
| 44 | $validations = array( |
| 45 | 'name' => array('presence'), |
| 46 | ); |
| 47 | return $validations; |
| 48 | } |
| 49 | } |