Skip to content

Commit

Permalink
Fix bug with saving comments & mins late
Browse files Browse the repository at this point in the history
  • Loading branch information
philipmclifton committed Mar 7, 2017
1 parent 9fe6d68 commit b3e21c4
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/Writeback/SessionAttendanceRecord.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,15 @@ public function toArray()
'attendance_code_id' => $this->getAttendanceCodeId()
];

if ($comment = $this->getComment() && ! empty($comment)) {
$comment = $this->getComment();

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

if($minutesLate = $this->getMinutesLate() && !empty($minutesLate)) {
$minutesLate = $this->getMinutesLate();

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

Expand Down Expand Up @@ -214,7 +218,7 @@ public function setComment($comment)
*/
public function setMinutesLate($number)
{
if(!is_numeric($number)) {
if ( ! is_numeric($number)) {
throw new InvalidInputException('Only pass a numeric value to minutes late');
}

Expand Down

0 comments on commit b3e21c4

Please sign in to comment.