19 declare(strict_types=1);
38 return $this->data_service->flashcardTerm(
39 (
int) $rec[
"term_id"],
40 (
int) $rec[
"user_id"],
52 $set = $this->db->queryF(
53 "SELECT * FROM glo_flashcard_term " .
54 " WHERE term_id = %s AND user_id = %s AND glo_id = %s ",
55 [
"integer",
"integer",
"integer"],
56 [$term_id, $user_id, $glo_id]
59 if ($rec = $this->db->fetchAssoc($set)) {
74 $set = $this->db->queryF(
75 "SELECT * FROM glo_flashcard_term " .
76 " WHERE box_nr = %s AND user_id = %s AND glo_id = %s " .
77 " ORDER BY last_access ASC ",
78 [
"integer",
"integer",
"integer"],
79 [$box_nr, $user_id, $glo_id]
83 while ($rec = $this->db->fetchAssoc($set)) {
97 $set = $this->db->queryF(
98 "SELECT * FROM glo_flashcard_term " .
99 " WHERE user_id = %s AND glo_id = %s " .
100 " ORDER BY last_access ASC ",
101 [
"integer",
"integer"],
106 while ($rec = $this->db->fetchAssoc($set)) {
116 $this->db->insert(
"glo_flashcard_term", [
117 "term_id" => [
"integer", $term->
getTermId()],
118 "user_id" => [
"integer", $term->
getUserId()],
119 "glo_id" => [
"integer", $term->
getGloId()],
121 "box_nr" => [
"integer", $term->
getBoxNr()]
128 $this->db->update(
"glo_flashcard_term", [
130 "box_nr" => [
"integer", $term->
getBoxNr()]
132 "term_id" => [
"integer", $term->
getTermId()],
133 "user_id" => [
"integer", $term->
getUserId()],
134 "glo_id" => [
"integer", $term->
getGloId()]
142 $q =
"DELETE FROM glo_flashcard_term " .
143 " WHERE glo_id = " . $this->db->quote($glo_id,
"integer") .
144 " AND user_id = " . $this->db->quote($user_id,
"integer");
145 $this->db->manipulate(
$q);
151 $q =
"DELETE FROM glo_flashcard_term " .
152 " WHERE user_id = " . $this->db->quote($user_id,
"integer");
153 $this->db->manipulate(
$q);
159 $q =
"DELETE FROM glo_flashcard_term " .
160 " WHERE glo_id = " . $this->db->quote($glo_id,
"integer");
161 $this->db->manipulate(
$q);
167 $q =
"DELETE FROM glo_flashcard_term " .
168 " WHERE term_id = " . $this->db->quote($term_id,
"integer");
169 $this->db->manipulate(
$q);
deleteEntries(int $glo_id, int $user_id)
getEntry(int $term_id, int $user_id, int $glo_id)
deleteAllTermEntries(int $term_id)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
getAllUserEntries(int $user_id, int $glo_id)
__construct(protected \ilDBInterface $db, protected InternalDataService $data_service)
getFromRecord(array $rec)
getUserEntriesForBox(int $box_nr, int $user_id, int $glo_id)
deleteAllUserEntries(int $user_id)
deleteAllGlossaryEntries(int $glo_id)