Example #1
0
 public function logoutEmployee(Employee $employee)
 {
     if ($employee->getWorkingNow() === false) {
         throw new HttpException(412, "Employee was not working");
     } else {
         $this->setStatus(200, 'Employee\'s working shift closed');
     }
     $employee->closeOpenShift();
     $employee->setWorkingNow(false);
     $this->persist($employee);
 }