DB Migration helper class.
More...
|
static | copyStyleClass ($a_orig_class, $a_class, $a_type, $a_tag, $a_hide=0) |
| Create style class GlossaryLink, link, IntLink. More...
|
|
◆ __construct()
ilScormEditorDBMigrationUtil::__construct |
( |
| ) |
|
◆ addStyleClass()
ilScormEditorDBMigrationUtil::addStyleClass |
( |
|
$a_class, |
|
|
|
$a_type, |
|
|
|
$a_tag, |
|
|
|
$a_parameters = "" , |
|
|
|
$a_hide = 0 |
|
) |
| |
Add style class.
- Parameters
-
Definition at line 88 of file class.ilScormEditorDBMigrationUtil.php.
References $a_type, $db, and $ilDB.
92 if ($a_parameters ==
"") {
93 $a_parameters = array();
96 $set =
$ilDB->query(
"SELECT * FROM object_data WHERE type = 'sty'");
97 while ($rec =
$ilDB->fetchAssoc($set)) {
98 $set2 =
$ilDB->query(
"SELECT * FROM style_char WHERE " .
99 "style_id = " .
$ilDB->quote($rec[
"obj_id"],
"integer") .
" AND " .
100 "characteristic = " .
$ilDB->quote($a_class,
"text") .
" AND " .
102 if (!
$ilDB->fetchAssoc($set2)) {
103 $q =
"INSERT INTO style_char (style_id, type, characteristic, hide)" .
105 $ilDB->quote($rec[
"obj_id"],
"integer") .
"," .
107 $ilDB->quote($a_class,
"text") .
"," .
108 $ilDB->quote($a_hide,
"integer") .
")";
110 $ilDB->manipulate($q);
111 foreach ($a_parameters as $k => $v) {
112 $spid =
$ilDB->nextId(
"style_parameter");
113 $q =
"INSERT INTO style_parameter (id, style_id, type, class, tag, parameter, value)" .
115 $ilDB->quote($spid,
"integer") .
"," .
116 $ilDB->quote($rec[
"obj_id"],
"integer") .
"," .
118 $ilDB->quote($a_class,
"text") .
"," .
119 $ilDB->quote($a_tag,
"text") .
"," .
120 $ilDB->quote($k,
"text") .
"," .
121 $ilDB->quote($v,
"text") .
124 $ilDB->manipulate($q);
◆ copyStyleClass()
static ilScormEditorDBMigrationUtil::copyStyleClass |
( |
|
$a_orig_class, |
|
|
|
$a_class, |
|
|
|
$a_type, |
|
|
|
$a_tag, |
|
|
|
$a_hide = 0 |
|
) |
| |
|
static |
Create style class GlossaryLink, link, IntLink.
- Parameters
-
Definition at line 36 of file class.ilScormEditorDBMigrationUtil.php.
References $a_type, $DIC, and $ilDB.
40 $ilDB = $DIC->database();
42 $set =
$ilDB->query(
"SELECT * FROM object_data WHERE type = 'sty'");
43 while ($rec =
$ilDB->fetchAssoc($set)) {
44 $set2 =
$ilDB->query(
"SELECT * FROM style_char WHERE " .
45 "style_id = " .
$ilDB->quote($rec[
"obj_id"],
"integer") .
" AND " .
46 "characteristic = " .
$ilDB->quote($a_class,
"text") .
" AND " .
48 if (!
$ilDB->fetchAssoc($set2)) {
49 $q =
"INSERT INTO style_char (style_id, type, characteristic, hide)" .
51 $ilDB->quote($rec[
"obj_id"],
"integer") .
"," .
53 $ilDB->quote($a_class,
"text") .
"," .
54 $ilDB->quote($a_hide,
"integer") .
")";
55 $ilDB->manipulate($q);
58 "SELECT * FROM style_parameter WHERE " .
59 "style_id = " .
$ilDB->quote($rec[
"obj_id"],
"integer") .
" AND " .
61 "class = " .
$ilDB->quote($a_orig_class,
"text") .
" AND " .
62 "tag = " .
$ilDB->quote($a_tag,
"text")
64 while ($rec3 =
$ilDB->fetchAssoc($set3)) {
65 $spid =
$ilDB->nextId(
"style_parameter");
66 $q =
"INSERT INTO style_parameter (id, style_id, type, class, tag, parameter, value)" .
68 $ilDB->quote($spid,
"integer") .
"," .
69 $ilDB->quote($rec[
"obj_id"],
"integer") .
"," .
70 $ilDB->quote($rec3[
"type"],
"text") .
"," .
71 $ilDB->quote($a_class,
"text") .
"," .
72 $ilDB->quote($a_tag,
"text") .
"," .
73 $ilDB->quote($rec3[
"parameter"],
"text") .
"," .
74 $ilDB->quote($rec3[
"value"],
"text") .
76 $ilDB->manipulate($q);
◆ $db
ilScormEditorDBMigrationUtil::$db |
|
protected |
The documentation for this class was generated from the following file: