ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
ILIAS\Blog\ReadingTime\ReadingTimeDBRepo Class Reference
+ Collaboration diagram for ILIAS\Blog\ReadingTime\ReadingTimeDBRepo:

Public Member Functions

 __construct ()
 
 isActivated (int $lm_id)
 
 activate (int $lm_id, bool $activated)
 

Protected Attributes

ilDBInterface $db
 

Detailed Description

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 12 of file class.ReadingTimeDBRepo.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\LearningModule\ReadingTime\ReadingTimeDBRepo::__construct ( )

Definition at line 16 of file class.ReadingTimeDBRepo.php.

References $DIC.

17  {
18  global $DIC;
19  $this->db = $DIC->database();
20  }
global $DIC
Definition: shib_login.php:25

Member Function Documentation

◆ activate()

ILIAS\Blog\ReadingTime\ReadingTimeDBRepo::activate ( int  $lm_id,
bool  $activated 
)

Definition at line 37 of file class.ReadingTimeDBRepo.php.

References ILIAS\Blog\ReadingTime\ReadingTimeDBRepo\$db, and ilDBInterface\update().

37  : void
38  {
39  $db = $this->db;
40  $db->update(
41  "il_blog",
42  [
43  "act_est_reading_time" => ["integer", $activated]
44  ],
45  [ // where
46  "id" => ["integer", $lm_id]
47  ]
48  );
49  }
update(string $table_name, array $values, array $where)
$where MUST contain existing columns only.
+ Here is the call graph for this function:

◆ isActivated()

ILIAS\Blog\ReadingTime\ReadingTimeDBRepo::isActivated ( int  $lm_id)

Definition at line 22 of file class.ReadingTimeDBRepo.php.

References ILIAS\Blog\ReadingTime\ReadingTimeDBRepo\$db, and ilDBInterface\queryF().

22  : bool
23  {
24  $db = $this->db;
25  $set = $db->queryF(
26  "SELECT act_est_reading_time FROM il_blog " .
27  " WHERE id = %s ",
28  ["integer"],
29  [$lm_id]
30  );
31  if ($rec = $db->fetchAssoc($set)) {
32  return (bool) $rec["act_est_reading_time"];
33  }
34  return false;
35  }
fetchAssoc(ilDBStatement $statement)
queryF(string $query, array $types, array $values)
+ Here is the call graph for this function:

Field Documentation

◆ $db

ilDBInterface ILIAS\Blog\ReadingTime\ReadingTimeDBRepo::$db
protected

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