ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ILIAS\Glossary\Flashcard\FlashcardBoxDBRepository Class Reference
+ Collaboration diagram for ILIAS\Glossary\Flashcard\FlashcardBoxDBRepository:

Public Member Functions

 __construct (\ilDBInterface $db)
 
 getEntry (int $box_nr, int $user_id, int $glo_id)
 
 createOrUpdateEntry (int $box_nr, int $user_id, int $glo_id, string $date)
 
 deleteEntries (int $glo_id, int $user_id)
 
 deleteAllUserEntries (int $user_id)
 
 deleteAllGlossaryEntries (int $glo_id)
 

Protected Attributes

ilDBInterface $db
 

Detailed Description

Author
Thomas Famula famul.nosp@m.a@le.nosp@m.ifos..nosp@m.de

Definition at line 26 of file class.FlashcardBoxDBRepository.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Glossary\Flashcard\FlashcardBoxDBRepository::__construct ( \ilDBInterface  $db)

Member Function Documentation

◆ createOrUpdateEntry()

ILIAS\Glossary\Flashcard\FlashcardBoxDBRepository::createOrUpdateEntry ( int  $box_nr,
int  $user_id,
int  $glo_id,
string  $date 
)

Definition at line 61 of file class.FlashcardBoxDBRepository.php.

66  : void {
67  $this->db->replace(
68  "glo_flashcard_box",
69  [
70  "box_nr" => ["integer", $box_nr],
71  "user_id" => ["integer", $user_id],
72  "glo_id" => ["integer", $glo_id]
73  ],
74  [
75  "last_access" => ["date", $date]
76  ]
77  );
78  }

◆ deleteAllGlossaryEntries()

ILIAS\Glossary\Flashcard\FlashcardBoxDBRepository::deleteAllGlossaryEntries ( int  $glo_id)

Definition at line 98 of file class.FlashcardBoxDBRepository.php.

References $q.

100  : void {
101  $q = "DELETE FROM glo_flashcard_box " .
102  " WHERE glo_id = " . $this->db->quote($glo_id, "integer");
103  $this->db->manipulate($q);
104  }
$q
Definition: shib_logout.php:21

◆ deleteAllUserEntries()

ILIAS\Glossary\Flashcard\FlashcardBoxDBRepository::deleteAllUserEntries ( int  $user_id)

Definition at line 90 of file class.FlashcardBoxDBRepository.php.

References $q.

92  : void {
93  $q = "DELETE FROM glo_flashcard_box " .
94  " WHERE user_id = " . $this->db->quote($user_id, "integer");
95  $this->db->manipulate($q);
96  }
$q
Definition: shib_logout.php:21

◆ deleteEntries()

ILIAS\Glossary\Flashcard\FlashcardBoxDBRepository::deleteEntries ( int  $glo_id,
int  $user_id 
)

Definition at line 80 of file class.FlashcardBoxDBRepository.php.

References $q.

83  : void {
84  $q = "DELETE FROM glo_flashcard_box " .
85  " WHERE glo_id = " . $this->db->quote($glo_id, "integer") .
86  " AND user_id = " . $this->db->quote($user_id, "integer");
87  $this->db->manipulate($q);
88  }
$q
Definition: shib_logout.php:21

◆ getEntry()

ILIAS\Glossary\Flashcard\FlashcardBoxDBRepository::getEntry ( int  $box_nr,
int  $user_id,
int  $glo_id 
)

Definition at line 36 of file class.FlashcardBoxDBRepository.php.

40  : array {
41  $set = $this->db->queryF(
42  "SELECT * FROM glo_flashcard_box " .
43  " WHERE box_nr = %s AND user_id = %s AND glo_id = %s ",
44  ["integer", "integer", "integer"],
45  [$box_nr, $user_id, $glo_id]
46  );
47 
48  $entry = [];
49  if ($rec = $this->db->fetchAssoc($set)) {
50  $entry = [
51  "box_nr" => $rec["box_nr"],
52  "user_id" => $rec["user_id"],
53  "glo_id" => $rec["glo_id"],
54  "last_access" => $rec["last_access"],
55  ];
56  }
57 
58  return $entry;
59  }

Field Documentation

◆ $db

ilDBInterface ILIAS\Glossary\Flashcard\FlashcardBoxDBRepository::$db
protected

The documentation for this class was generated from the following file: