ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\Glossary\Flashcard\FlashcardBoxDBRepository Class Reference
+ Collaboration diagram for ILIAS\Glossary\Flashcard\FlashcardBoxDBRepository:

Public Member Functions

 __construct (protected \ilDBInterface $db, protected InternalDataService $data_service)
 
 getEntry (int $box_nr, int $user_id, int $glo_id)
 
 createOrUpdateEntry (Box $box)
 
 deleteEntries (int $glo_id, int $user_id)
 
 deleteAllUserEntries (int $user_id)
 
 deleteAllGlossaryEntries (int $glo_id)
 

Protected Member Functions

 getFromRecord (array $rec)
 

Detailed Description

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

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

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Glossary\Flashcard\FlashcardBoxDBRepository::__construct ( protected \ilDBInterface  $db,
protected InternalDataService  $data_service 
)

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

33 {
34 }

Member Function Documentation

◆ createOrUpdateEntry()

ILIAS\Glossary\Flashcard\FlashcardBoxDBRepository::createOrUpdateEntry ( Box  $box)

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

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

◆ deleteAllGlossaryEntries()

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

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

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

◆ deleteAllUserEntries()

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

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

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

◆ deleteEntries()

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

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

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

◆ getEntry()

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

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

50 : ?Box {
51 $set = $this->db->queryF(
52 "SELECT * FROM glo_flashcard_box " .
53 " WHERE box_nr = %s AND user_id = %s AND glo_id = %s ",
54 ["integer", "integer", "integer"],
55 [$box_nr, $user_id, $glo_id]
56 );
57
58 if ($rec = $this->db->fetchAssoc($set)) {
59 return $this->getFromRecord($rec);
60 }
61
62 return null;
63 }

References ILIAS\Glossary\Flashcard\FlashcardBoxDBRepository\getFromRecord().

+ Here is the call graph for this function:

◆ getFromRecord()

ILIAS\Glossary\Flashcard\FlashcardBoxDBRepository::getFromRecord ( array  $rec)
protected

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

36 : Box
37 {
38 return $this->data_service->flashcardBox(
39 (int) $rec["box_nr"],
40 (int) $rec["user_id"],
41 (int) $rec["glo_id"],
42 $rec["last_access"]
43 );
44 }

Referenced by ILIAS\Glossary\Flashcard\FlashcardBoxDBRepository\getEntry().

+ Here is the caller graph for this function:

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