Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,7 @@ $attendance = new \Wonde\Writeback\LessonAttendanceRecord();
$attendance->setStudentId('STUDENT_ID_GOES_HERE');
$attendance->setLessonId('LESSON_ID_GOES_HERE');
$attendance->setAttendanceCodeId('ATTENDANCE_CODE_ID_GOES_HERE');
$attendance->setComment('Comment here.');

// Add attendance mark to register
$register->add($attendance);
Expand Down
33 changes: 32 additions & 1 deletion src/Writeback/LessonAttendanceRecord.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ class LessonAttendanceRecord
*/
private $attendance_code_id;

/**
* @var string
*/
private $comment;

/**
* Set student id
*
Expand Down Expand Up @@ -114,7 +119,33 @@ public function toArray()
'attendance_code_id' => $this->getAttendanceCodeId()
];

$comment = $this->getComment();

if ( ! empty($comment)) {
$required['comment'] = $comment;
}

return $required;
}

}
/**
* Get the comment value
*
* @return string
*/
public function getComment()
{
return $this->comment;
}

/**
* Set the comment value
*
* @param string $comment
*/
public function setComment($comment)
{
$this->comment = $comment;
}

}