ILIAS  trunk Revision v11.0_alpha-1769-g99a433fe2dc
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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 26 of file class.ReadingTimeDBRepo.php.

Constructor & Destructor Documentation

◆ __construct()

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

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

References $DIC.

31  {
32  global $DIC;
33  $this->db = $DIC->database();
34  }
global $DIC
Definition: shib_login.php:22

Member Function Documentation

◆ activate()

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

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

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

51  : void
52  {
53  $db = $this->db;
54  $db->update(
55  "il_blog",
56  [
57  "act_est_reading_time" => ["integer", $activated]
58  ],
59  [ // where
60  "id" => ["integer", $lm_id]
61  ]
62  );
63  }
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 36 of file class.ReadingTimeDBRepo.php.

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

36  : bool
37  {
38  $db = $this->db;
39  $set = $db->queryF(
40  "SELECT act_est_reading_time FROM il_blog " .
41  " WHERE id = %s ",
42  ["integer"],
43  [$lm_id]
44  );
45  if ($rec = $db->fetchAssoc($set)) {
46  return (bool) $rec["act_est_reading_time"];
47  }
48  return false;
49  }
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: