Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 13 |
|
0.00% |
0 / 8 |
CRAP | |
0.00% |
0 / 1 |
Theme | |
0.00% |
0 / 13 |
|
0.00% |
0 / 8 |
72 | |
0.00% |
0 / 1 |
__construct | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
set_theme_name | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
get_theme_name | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
set_theme_image | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
get_theme_image | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
set_is_newfold_theme | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
get_is_newfold_theme | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
jsonSerialize | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | |
3 | namespace NewfoldLabs\WP\Module\Onboarding\Models; |
4 | |
5 | /** |
6 | * Class Theme |
7 | */ |
8 | class Theme implements \JsonSerializable { |
9 | |
10 | /** |
11 | * Name of the Theme. |
12 | * |
13 | * @var string |
14 | */ |
15 | private $theme_name; |
16 | |
17 | /** |
18 | * Theme image Path. |
19 | * |
20 | * @var string |
21 | */ |
22 | private $theme_image; |
23 | |
24 | /** |
25 | * Status of a theme being a Newfold Theme. |
26 | * |
27 | * @var boolean |
28 | */ |
29 | private $is_newfold_theme; |
30 | |
31 | /** |
32 | * Theme constructor. |
33 | * |
34 | * @param string $theme_name Theme Name. |
35 | */ |
36 | public function __construct( $theme_name ) { |
37 | $this->theme_name = $theme_name; |
38 | $this->is_newfold_theme = false; |
39 | } |
40 | |
41 | /** |
42 | * Sets the Theme Name |
43 | * |
44 | * @param string $theme_name name of the theme. |
45 | * @return void |
46 | */ |
47 | public function set_theme_name( $theme_name ) { |
48 | $this->theme_name = $theme_name; |
49 | } |
50 | |
51 | /** |
52 | * Retrieve the Theme Name |
53 | * |
54 | * @return string |
55 | */ |
56 | public function get_theme_name() { |
57 | return $this->theme_name; |
58 | } |
59 | |
60 | /** |
61 | * Sets the Theme image path |
62 | * |
63 | * @param string $theme_image Path to theme screenshot image. |
64 | * @return void |
65 | */ |
66 | public function set_theme_image( $theme_image ) { |
67 | $this->theme_image = $theme_image; |
68 | } |
69 | |
70 | /** |
71 | * Retrieve the path to theme screenshot image |
72 | * |
73 | * @return string |
74 | */ |
75 | public function get_theme_image() { |
76 | return $this->theme_image; |
77 | } |
78 | |
79 | /** |
80 | * Sets the status of a theme as a Newfold theme. |
81 | * |
82 | * @param boolean $is_newfold_theme Determines if there is a Newfold theme |
83 | * @return void |
84 | */ |
85 | public function set_is_newfold_theme( $is_newfold_theme ) { |
86 | $this->is_newfold_theme = $is_newfold_theme; |
87 | } |
88 | |
89 | /** |
90 | * Retrieve is_newfold_theme status - true if the theme author is Newfold Digital. |
91 | * |
92 | * @return boolean |
93 | */ |
94 | public function get_is_newfold_theme() { |
95 | return $this->is_newfold_theme; |
96 | } |
97 | |
98 | /** |
99 | * To JSON Serialize the Theme data |
100 | * |
101 | * @return array |
102 | */ |
103 | public function jsonSerialize() { |
104 | return array( |
105 | 'name' => $this->theme_name, |
106 | 'image' => $this->theme_image, |
107 | 'isNewfoldTheme' => $this->is_newfold_theme, |
108 | ); |
109 | } |
110 | } |