-
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathindex.php
More file actions
22 lines (16 loc) · 649 Bytes
/
Copy pathindex.php
File metadata and controls
22 lines (16 loc) · 649 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php
use App\StudentBO;
require 'vendor/autoload.php';
$studentBusinessObject = new StudentBO();
//print all students
$students = $studentBusinessObject->getAllStudents();
foreach ($students->list as $student) {
print sprintf("Student: [RollNo: %s , Name: %s]" . PHP_EOL, $student->getRollNo(), $student->getName());
}
//update student
$student = $studentBusinessObject->getStudent(0);
$student->setName("Michael");
$studentBusinessObject->updateStudent($student);
//get the student
$student = $studentBusinessObject->getStudent(0);
print sprintf("Student: [RollNo: %s , Name: %s]" . PHP_EOL, $student->getRollNo(), $student->getName());