3 declare(strict_types=1);
    18     public function __construct(
string $orig_class, 
string $class, 
string $type, 
string $tag, 
int $hide = 0)
    21         $this->
class = $class;
    29         return hash(
"sha256", self::class);
    34         return "Copy style class";
    51         $db = $environment->
getResource(Environment::RESOURCE_DATABASE);
    54             "SELECT obj_id" . PHP_EOL
    55             . 
"FROM object_data" . PHP_EOL
    56             . 
"WHERE type = 'sty'" . PHP_EOL
    59         $result = $db->query($sql);
    61         while ($row = $db->fetchAssoc($result)) {
    63                 "SELECT style_id, type, characteristic, hide" . PHP_EOL
    64                 . 
"FROM style_char" . PHP_EOL
    65                 . 
"WHERE style_id = " . $db->quote($row[
"obj_id"], 
"integer") . PHP_EOL
    66                 . 
"AND characteristic = " . $db->quote($this->
class, 
"text") . PHP_EOL
    67                 . 
"AND type = " . $db->quote($this->type, 
"text") . PHP_EOL
    69             $res = $db->query($sql);
    71             if (!$db->fetchAssoc(
$res)) {
    73                     "style_id" => [
"integer", $row[
"obj_id"]],
    78                 $db->insert(
"style_char", $values);
    81                     "SELECT id, style_id, tag, class, parameter, value, type, mq_id, custom" . PHP_EOL
    82                     . 
"FROM style_parameter" . PHP_EOL
    83                     . 
"WHERE style_id = " . $db->quote($row[
"obj_id"], 
"integer") . PHP_EOL
    84                     . 
"AND type = " . $db->quote($this->type, 
"text") . PHP_EOL
    85                     . 
"AND class = " . $db->quote($this->orig_class, 
"text") . PHP_EOL
    86                     . 
"AND tag = " . $db->quote($this->tag, 
"text") . PHP_EOL
    89                 $res = $db->query($sql);
    91                 while ($row_2 = $db->fetchAssoc(
$res)) {
    92                     $spid = $db->nextId(
"style_parameter");
    94                         "id" => [
"integer", $spid],
    95                         "style_id" => [
"integer", $row[
"obj_id"]],
    98                         "parameter" => [
"text", $row_2[
"parameter"]],
    99                         "value" => [
"text", $row_2[
"value"]],
   100                         "type" => [
"text", $row_2[
"type"]]
   102                     $db->insert(
"style_parameter", $values);
   112         $db = $environment->
getResource(Environment::RESOURCE_DATABASE);
   115             "SELECT obj_id" . PHP_EOL
   116             . 
"FROM object_data" . PHP_EOL
   117             . 
"WHERE type = 'sty'" . PHP_EOL
   119         $result = $db->query($sql);
   121         if ($db->numRows($result) == 0) {
   125         while ($row = $db->fetchAssoc($result)) {
   127                 "SELECT style_id, type, characteristic, hide" . PHP_EOL
   128                 . 
"FROM style_char" . PHP_EOL
   129                 . 
"WHERE style_id = " . $db->quote($row[
"obj_id"], 
"integer") . PHP_EOL
   130                 . 
"AND characteristic = " . $db->quote($this->
class, 
"text") . PHP_EOL
   131                 . 
"AND type = " . $db->quote($this->type, 
"text") . PHP_EOL
   134             $res = $db->query($sql);
   136             if ($db->numRows(
$res)) {
 __construct(string $orig_class, string $class, string $type, string $tag, int $hide=0)
 
achieve(Environment $environment)
 
isApplicable(Environment $environment)
 
getResource(string $id)
Consumers of this method should check if the result is what they expect, e.g. 
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
An environment holds resources to be used in the setup process. 
 
getPreconditions(Environment $environment)