|
1
|
|
|
<?php namespace Bedard\Shop\Models; |
|
2
|
|
|
|
|
3
|
|
|
use Model; |
|
4
|
|
|
|
|
5
|
|
|
/** |
|
6
|
|
|
* Api Settings Model. |
|
7
|
|
|
*/ |
|
8
|
|
|
class ApiSettings extends Model |
|
9
|
|
|
{ |
|
10
|
|
|
/** |
|
11
|
|
|
* @var array Behaviors |
|
12
|
|
|
*/ |
|
13
|
|
|
public $implement = ['System.Behaviors.SettingsModel']; |
|
14
|
|
|
|
|
15
|
|
|
/** |
|
16
|
|
|
* @var string Settings code |
|
17
|
|
|
*/ |
|
18
|
|
|
public $settingsCode = 'bedard_shop_settings_api'; |
|
19
|
|
|
|
|
20
|
|
|
/** |
|
21
|
|
|
* @var string Settings fields |
|
22
|
|
|
*/ |
|
23
|
|
|
public $settingsFields = 'fields.yaml'; |
|
24
|
|
|
|
|
25
|
|
|
public static function categoriesHideEmpty() |
|
26
|
|
|
{ |
|
27
|
|
|
return self::get('categories_hide_empty', false); |
|
28
|
|
|
} |
|
29
|
|
|
|
|
30
|
|
|
public static function categoriesLoadThumbnails() |
|
31
|
|
|
{ |
|
32
|
|
|
return self::get('categories_load_thumbnails', false); |
|
33
|
|
|
} |
|
34
|
|
|
|
|
35
|
|
|
public static function categoriesSelect() |
|
36
|
|
|
{ |
|
37
|
|
|
return self::get('categories_select', []); |
|
38
|
|
|
} |
|
39
|
|
|
|
|
40
|
|
|
public static function categoryLoadProducts() |
|
41
|
|
|
{ |
|
42
|
|
|
return self::get('category_load_products', false); |
|
43
|
|
|
} |
|
44
|
|
|
|
|
45
|
|
|
public static function categoryLoadProductsThumbnails() |
|
46
|
|
|
{ |
|
47
|
|
|
return self::get('category_load_products_thumbnails', false); |
|
48
|
|
|
} |
|
49
|
|
|
|
|
50
|
|
|
public static function categoryLoadThumbnails() |
|
51
|
|
|
{ |
|
52
|
|
|
return self::get('category_load_thumbnails', false); |
|
53
|
|
|
} |
|
54
|
|
|
|
|
55
|
|
|
public static function categorySelect() |
|
56
|
|
|
{ |
|
57
|
|
|
return self::get('category_select', []); |
|
58
|
|
|
} |
|
59
|
|
|
|
|
60
|
|
|
public static function categoryProductsSelect() |
|
61
|
|
|
{ |
|
62
|
|
|
return self::get('category_products_select', []); |
|
63
|
|
|
} |
|
64
|
|
|
|
|
65
|
|
|
/** |
|
66
|
|
|
* Determines if the HTTP API is enabled. |
|
67
|
|
|
* |
|
68
|
|
|
* @return bool |
|
69
|
|
|
*/ |
|
70
|
|
|
public static function isEnabled() |
|
71
|
|
|
{ |
|
72
|
|
|
return self::get('is_enabled', false); |
|
73
|
|
|
} |
|
74
|
|
|
} |
|
75
|
|
|
|