19 declare(strict_types=1);
    32     protected \ilDBInterface 
$db;
    45         if ($this->has_data) {
    49         $res = $this->db->query(
"SELECT * FROM " . self::TABLE_NAME);
    51         foreach ($this->db->fetchAll(
$res) as 
$data) {
    52             $this->data[$data[
"plugin_id"]] = [
    53                 (bool) $data[
"active"],
    54                 $data[
"last_update_version"] ? $this->data_factory->version($data[
"last_update_version"]) : null,
    55                 $data[
"db_version"] ? (
int) $data[
"db_version"] : null
    58         $this->has_data = 
true;
    64         return $this->data[
$id][0] ?? 
false;
    70         if (!isset($this->data[$id])) {
    71             throw new \InvalidArgumentException(
    72                 "Unknown plugin '$id'"    78                 "active" => [
"integer", $activated ? 1 : 0]
    81                 "plugin_id" => [
"text", $id]
    84         $this->has_data = 
false;
    90         return $this->data[
$id][1] ?? null;
    96         return $this->data[
$id][2] ?? null;
   102         if (isset($this->data[$id])) {
   106                     "last_update_version" => [
"text", (
string) $version],
   107                     "db_version" => [
"integer", $db_version]
   110                     "plugin_id" => [
"text", $id]
   117                     "plugin_id" => [
"text", $id],
   118                     "active" => [
"integer", 0],
   119                     "last_update_version" => [
"text", (
string) $version],
   120                     "db_version" => [
"integer", $db_version]
   124         $this->has_data = 
false;
   127     public function remove(
string $id): 
void   129         $this->db->manipulate(
   130             "DELETE FROM " . self::TABLE_NAME . 
" WHERE plugin_id = " . $this->db->quote(
$id, 
"text")
   132         $this->has_data = 
false;
 
Data Factory $data_factory
 
Implementation of ilPluginStateDB over ilDBInterface. 
 
isPluginActivated(string $id)
 
getCurrentPluginVersion(string $id)
 
setCurrentPluginVersion(string $id, Version $version, int $db_version)
 
__construct(Data\Factory $data_factory, \ilDBInterface $db)
 
Repository interface for plugin state data. 
 
getCurrentPluginDBVersion(string $id)
 
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins 
 
setActivation(string $id, bool $activated)
 
A version number that consists of three numbers (major, minor, patch). 
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...