Skip to content

Commit 4a8babb

Browse files
cdplantHodglim
andauthored
Add support for employee IDs in session attendace writebacks (#18)
* Add support for employee IDs in session attendace writebacks * Update SessionAttendanceRecord.php Updated casing for consistency Co-authored-by: Darren Hodges <[email protected]>
1 parent 8f169dc commit 4a8babb

File tree

2 files changed

+36
-3
lines changed

2 files changed

+36
-3
lines changed

src/Client.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class Client
3131
/**
3232
* @var string
3333
*/
34-
const version = '2.1.1';
34+
const version = '2.1.2';
3535

3636
/**
3737
* Client constructor.

src/Writeback/SessionAttendanceRecord.php

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ class SessionAttendanceRecord
1111
*/
1212
private $student_id;
1313

14+
/**
15+
* @var string
16+
*/
17+
private $employee_id;
18+
1419
/**
1520
* @var string
1621
*/
@@ -39,7 +44,7 @@ class SessionAttendanceRecord
3944
/**
4045
* Set student id
4146
*
42-
* @param string $date
47+
* @param string $studentId
4348
* @return void
4449
* @throws InvalidAttendanceException
4550
*/
@@ -52,6 +57,18 @@ public function setStudentId($studentId)
5257
$this->student_id = $studentId;
5358
}
5459

60+
/**
61+
* Set employee id
62+
*
63+
* @param string $employeeId
64+
* @return void
65+
* @throws InvalidAttendanceException
66+
*/
67+
public function setEmployeeId($employeeId)
68+
{
69+
$this->employee_id = $employeeId;
70+
}
71+
5572
/**
5673
* Set date
5774
*
@@ -131,6 +148,16 @@ public function getStudentId()
131148
return $this->student_id;
132149
}
133150

151+
/**
152+
* Return the student id
153+
*
154+
* @return string
155+
*/
156+
public function getEmployeeId()
157+
{
158+
return $this->employee_id;
159+
}
160+
134161
/**
135162
* Return the date
136163
*
@@ -180,6 +207,12 @@ public function toArray()
180207
if ( ! empty($comment)) {
181208
$required['comment'] = $comment;
182209
}
210+
211+
$employeeId = $this->getEmployeeId();
212+
213+
if ( ! empty($employeeId)) {
214+
$required['employee_id'] = $employeeId;
215+
}
183216

184217
$minutesLate = $this->getMinutesLate();
185218

@@ -234,4 +267,4 @@ public function getMinutesLate()
234267
{
235268
return $this->minutesLate;
236269
}
237-
}
270+
}

0 commit comments

Comments
 (0)