| 1 |
<?php |
| 2 |
|
| 3 |
namespace Elementor\App\Modules\Onboarding\Storage\Entities; |
| 4 |
|
| 5 |
if ( ! defined( 'ABSPATH' ) ) { |
| 6 |
exit; |
| 7 |
} |
| 8 |
|
| 9 |
class User_Choices { |
| 10 |
|
| 11 |
private ?string $building_for = null; |
| 12 |
private array $site_about = []; |
| 13 |
private ?string $experience_level = null; |
| 14 |
private ?string $theme_selection = null; |
| 15 |
private array $site_features = []; |
| 16 |
|
| 17 |
public static function from_array( array $data ): self { |
| 18 |
$instance = new self(); |
| 19 |
|
| 20 |
$instance->building_for = $data['building_for'] ?? null; |
| 21 |
$instance->site_about = $data['site_about'] ?? []; |
| 22 |
$instance->experience_level = $data['experience_level'] ?? null; |
| 23 |
$instance->theme_selection = $data['theme_selection'] ?? null; |
| 24 |
$instance->site_features = $data['site_features'] ?? []; |
| 25 |
|
| 26 |
return $instance; |
| 27 |
} |
| 28 |
|
| 29 |
public function to_array(): array { |
| 30 |
return [ |
| 31 |
'building_for' => $this->building_for, |
| 32 |
'site_about' => $this->site_about, |
| 33 |
'experience_level' => $this->experience_level, |
| 34 |
'theme_selection' => $this->theme_selection, |
| 35 |
'site_features' => $this->site_features, |
| 36 |
]; |
| 37 |
} |
| 38 |
|
| 39 |
public function get_building_for(): ?string { |
| 40 |
return $this->building_for; |
| 41 |
} |
| 42 |
|
| 43 |
public function set_building_for( ?string $value ): void { |
| 44 |
$this->building_for = $value; |
| 45 |
} |
| 46 |
|
| 47 |
public function get_site_about(): array { |
| 48 |
return $this->site_about; |
| 49 |
} |
| 50 |
|
| 51 |
public function set_site_about( array $value ): void { |
| 52 |
$this->site_about = $value; |
| 53 |
} |
| 54 |
|
| 55 |
public function get_experience_level(): ?string { |
| 56 |
return $this->experience_level; |
| 57 |
} |
| 58 |
|
| 59 |
public function set_experience_level( ?string $value ): void { |
| 60 |
$this->experience_level = $value; |
| 61 |
} |
| 62 |
|
| 63 |
public function get_theme_selection(): ?string { |
| 64 |
return $this->theme_selection; |
| 65 |
} |
| 66 |
|
| 67 |
public function set_theme_selection( ?string $value ): void { |
| 68 |
$this->theme_selection = $value; |
| 69 |
} |
| 70 |
|
| 71 |
public function get_site_features(): array { |
| 72 |
return $this->site_features; |
| 73 |
} |
| 74 |
|
| 75 |
public function set_site_features( array $value ): void { |
| 76 |
$this->site_features = $value; |
| 77 |
} |
| 78 |
} |
| 79 |
|