26 $this->db = (is_null(
$db))
38 public function remove(
int $survey_id,
int $user_id)
43 "DELETE FROM svy_invitation WHERE " .
44 " survey_id = %s AND user_id = %s",
45 [
"integer",
"integer"],
46 [$survey_id, $user_id]
57 public function add(
int $survey_id,
int $user_id)
64 "survey_id" => [
"integer", $survey_id],
65 "user_id" => [
"integer", $user_id]
83 "SELECT user_id FROM svy_invitation " .
84 " WHERE survey_id = %s ",
89 while ($rec =
$db->fetchAssoc($set)) {
90 $items[] = $rec[
"user_id"];
107 "SELECT survey_id FROM svy_invitation " .
108 " WHERE user_id = %s ",
113 while ($rec =
$db->fetchAssoc($set)) {
114 $items[] = (int) $rec[
"survey_id"];
getAllForUser(int $user_id)
Get surveys where user is invited.
__construct(\ilDBInterface $db=null)
Constructor.
add(int $survey_id, int $user_id)
Add invitation.
Survey invitations repository.
getAllForSurvey(int $survey_id)
Get invitations for survey.