-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRepository.php
34 lines (22 loc) · 1001 Bytes
/
Repository.php
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
<?php
class Repository{
var $repo;
var $firstNameKey = 'firstname';
var $lastNameKey = 'lastname';
var $idKey = 'id';
var $imageKey = 'image';
function createRepository(){
$s1 = Array($this->firstNameKey => 'Moti', $this->lastNameKey => 'Bartov', $this->idKey => '031992654', $this->imageKey => 'moti.jpg');
$s2 = Array($this->firstNameKey => 'Mickey', $this->lastNameKey => 'Mouse', $this->idKey => '555', $this->imageKey => 'mickey.jpg');
$s3 = Array($this->firstNameKey => 'Donald', $this->lastNameKey => 'Douck', $this->idKey => '555', $this->imageKey => 'donald.jpg');
$s4 = Array($this->firstNameKey => 'Ariel', $this->lastNameKey => 'Yust', $this->idKey => '555', $this->imageKey => 'ariel.jpg');
$this->repo = Array($s1, $s2, $s3, $s4);
}
function getStudents(){
return $this->repo;
}
function getStudent($id){
return $this->repo[$id];
}
}
?>