Beispiel #1
0
 /**
  * @param Solver $solver
  * @return Solver
  * @throws OptimiseException
  */
 private function setUsersMeetings(Solver $solver)
 {
     $users = $solver->getUsers();
     $meetings = $solver->getMeetings();
     /**
      * @var $usersMeetings \Illuminate\Support\Collection
      */
     $usersMeetings = collect($this->company->getUsersMeetings($users, $meetings))->groupBy('employee_id');
     if ($usersMeetings->count() == 0) {
         throw (new OptimiseException("No users for any meeting"))->withEmpty(true);
     }
     return $solver->setUsersMeetings(self::getUsersMeetingsArray($users, $meetings, $usersMeetings));
 }