40 $this->repo = (is_null(
$repo))
60 public function remove(
int $survey_id,
int $user_id)
62 $this->repo->remove($survey_id, $user_id);
72 public function add(
int $survey_id,
int $user_id)
74 $this->repo->add($survey_id, $user_id);
85 return $this->repo->getAllForSurvey($survey_id);
97 $survey_ids = $this->repo->getAllForUser($user_id);
100 $finished_surveys = $this->run_repo->getFinishedSurveysOfUser($user_id);
102 $open_surveys = array_filter($survey_ids,
function (
$i) use ($finished_surveys) {
103 return !in_array(
$i, $finished_surveys);
107 $has_ended = $this->set_repo->hasEnded($open_surveys);
108 $open_surveys = array_filter($open_surveys,
function (
$i) use ($has_ended) {
109 return !$has_ended[
$i];
112 return $open_surveys;
add(int $survey_id, int $user_id)
Add invitation.
getAllForSurvey(int $survey_id)
Get invitations for survey.
Survey invitations repository.
getOpenInvitationsOfUser(int $user_id)
Get all open invitations of a user.
Survey settings db repository.
__construct(InvitationsDBRepository $repo=null, Execution\RunDBRepository $run_repo=null, Settings\SettingsDBRepository $set_repo=null)
Constructor.