1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
<?php
namespace hji\homevalue\models;
class Settings
{
const KEY = 'hji-homevalue-settings';
function __construct()
{
$data = $this->getOptions();
$this->results_page_id = !empty($data['results_page_id']) ? trim($data['results_page_id']) : false;
$this->cma_page_id = !empty($data['cma_page_id']) ? trim($data['cma_page_id']) : false;
$this->registration_on = !empty($data['registration_on']) ? trim($data['registration_on']) : false;
$this->street_view_widget = !empty($data['street_view_widget']) ? trim($data['street_view_widget']) : false;
$this->recent_sales_widget = !empty($data['recent_sales_widget']) ? trim($data['recent_sales_widget']) : false;
$this->imported_forms = !empty($data['imported_forms']) ? $data['imported_forms'] : false;
}
function getOptions()
{
return get_option(self::KEY);
}
function updateOptions($settings)
{
return update_option(self::KEY, $settings);
}
}