-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstudent.php
More file actions
35 lines (29 loc) · 933 Bytes
/
student.php
File metadata and controls
35 lines (29 loc) · 933 Bytes
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
<?php
/**
* Student
*
* Define los atributos característicos del estudiante.
*/
require 'person.php';
class Student extends Person implements JsonSerializable {
private $semester;
public function __construct($firstName, $lastName, $city, $semester, $id = null) {
parent::__construct($id, $firstName, $lastName, $city);
$this->semester = $semester;
}
public function getSemester() {
return $this->semester;
}
public function setSemester($semester) {
$this->semester = $semester;
}
public function jsonSerialize() {
return [
'id' => $this->id,
'firstName' => $this->firstName,
'lastName' => $this->lastName,
'city' => $this->city,
'semester' => $this->semester
];
}
}