1 | <?php |
||
5 | class Registration extends Form |
||
6 | { |
||
7 | protected $email; |
||
8 | protected $password; |
||
9 | protected $name; |
||
10 | protected $country = 'GB'; |
||
11 | protected $age = 18; |
||
12 | protected $gender = 'male'; |
||
13 | protected $site; |
||
14 | |||
15 | /** |
||
16 | * @param string $email |
||
17 | * @param string $password |
||
18 | * @param string $name |
||
19 | */ |
||
20 | public function __construct($email, $password, $name) |
||
21 | { |
||
22 | $this->email = $email; |
||
23 | $this->password = $password; |
||
24 | $this->name = $name; |
||
25 | } |
||
26 | |||
27 | /** |
||
28 | * @param mixed $email |
||
29 | * @return Registration |
||
30 | */ |
||
31 | public function setEmail($email) |
||
32 | { |
||
33 | $this->email = $email; |
||
34 | return $this; |
||
35 | } |
||
36 | |||
37 | /** |
||
38 | * @param mixed $password |
||
39 | * @return Registration |
||
40 | */ |
||
41 | public function setPassword($password) |
||
42 | { |
||
43 | $this->password = $password; |
||
44 | return $this; |
||
45 | } |
||
46 | |||
47 | /** |
||
48 | * @param mixed $name |
||
49 | * @return Registration |
||
50 | */ |
||
51 | public function setName($name) |
||
52 | { |
||
53 | $this->name = $name; |
||
54 | return $this; |
||
55 | } |
||
56 | |||
57 | /** |
||
58 | * @param mixed $country |
||
59 | * @return Registration |
||
60 | */ |
||
61 | public function setCountry($country) |
||
62 | { |
||
63 | $this->country = $country; |
||
64 | return $this; |
||
65 | } |
||
66 | |||
67 | /** |
||
68 | * @param mixed $age |
||
69 | * @return Registration |
||
70 | */ |
||
71 | public function setAge($age) |
||
72 | { |
||
73 | $this->age = $age; |
||
74 | return $this; |
||
75 | } |
||
76 | |||
77 | /** |
||
78 | * @param mixed $gender |
||
79 | * @return Registration |
||
80 | */ |
||
81 | public function setGender($gender) |
||
82 | { |
||
83 | $this->gender = $gender; |
||
84 | return $this; |
||
85 | } |
||
86 | |||
87 | /** |
||
88 | * @return Registration |
||
89 | */ |
||
90 | public function setMaleGender() |
||
91 | { |
||
92 | return $this->setGender('male'); |
||
93 | } |
||
94 | |||
95 | /** |
||
96 | * @return Registration |
||
97 | */ |
||
98 | public function setFemaleGender() |
||
99 | { |
||
100 | return $this->setGender('female'); |
||
101 | } |
||
102 | |||
103 | /** |
||
104 | * @return array |
||
105 | */ |
||
106 | public function getData() |
||
107 | { |
||
108 | |||
109 | return [ |
||
110 | 'first_name' => $this->name, |
||
111 | 'email' => $this->email, |
||
112 | 'password' => $this->password, |
||
113 | 'age' => $this->age, |
||
114 | 'gender' => $this->gender, |
||
115 | 'country' => $this->country, |
||
116 | 'site' => $this->site, |
||
117 | 'container' => 'home_page', |
||
118 | 'visited_pages' => [], |
||
119 | ]; |
||
120 | } |
||
121 | |||
122 | /** |
||
123 | * @param mixed $site |
||
124 | * @return Registration |
||
125 | */ |
||
126 | public function setSite($site) |
||
131 | |||
132 | /** |
||
133 | * @return string |
||
134 | */ |
||
135 | public function getSite() |
||
139 | } |