ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilDatabaseCommonTestMockData Class Reference

Class ilDatabaseCommonTestMockData. More...

+ Inheritance diagram for ilDatabaseCommonTestMockData:
+ Collaboration diagram for ilDatabaseCommonTestMockData:

Public Member Functions

 getNow ()
 
 getLike ()
 
 getLocate ()
 
 getConcat ($allow_null=true)
 
 getDBFields ()
 
 getInputArray ($update_mob_id=false, $blob_null=true, $with_clob=true)
 
 getInputArrayForTransaction ()
 
 getInsertQuery ($table_name)
 
 getTableCreateSQL ($tablename, $engine)
 
 getTableCreateSQLAfterRename ($tablename, $engine, $supports_fulltext)
 
 getTableCreateSQLAfterAlter ($tablename, $engine, $supports_fulltext)
 

Detailed Description

Member Function Documentation

◆ getConcat()

ilDatabaseCommonTestMockData::getConcat (   $allow_null = true)
Returns
string

Definition at line 41 of file class.ilDatabaseCommonTestMockData.php.

42 {
43 if ($allow_null) {
44 return " CONCAT(COALESCE(o,''),COALESCE(t,''),COALESCE(t,'')) ";
45 } else {
46 return " CONCAT(o,t,t) ";
47 }
48 }

◆ getDBFields()

ilDatabaseCommonTestMockData::getDBFields ( )
Returns
array

Definition at line 54 of file class.ilDatabaseCommonTestMockData.php.

55 {
56 $fields = array(
57 'id' => array(
58 'type' => 'integer',
59 'length' => 4,
60 'notnull' => true,
61 ),
62 'is_online' => array(
63 'type' => 'integer',
64 'length' => 1,
65 'notnull' => false,
66 ),
67 'is_default' => array(
68 'type' => 'integer',
69 'length' => 1,
70 'notnull' => false,
71 'default' => 1,
72 ),
73 'latitude' => array(
74 'type' => 'float',
75 ),
76 'longitude' => array(
77 'type' => 'float',
78 ),
79 'elevation' => array(
80 'type' => 'float',
81 ),
82 'address' => array(
83 'type' => 'text',
84 'length' => 256,
85 'notnull' => false,
86 ),
87 'init_mob_id' => array(
88 'type' => 'integer',
89 'length' => 4,
90 'notnull' => false,
91 ),
92 'comment_mob_id' => array(
93 'type' => 'integer',
94 'length' => 4,
95 ),
96 'container_id' => array(
97 'type' => 'integer',
98 'length' => 4,
99 ),
100 'big_data' => array(
101 'type' => 'clob',
102 ),
103 );
104
105 return $fields;
106 }

◆ getInputArray()

ilDatabaseCommonTestMockData::getInputArray (   $update_mob_id = false,
  $blob_null = true,
  $with_clob = true 
)
Parameters
bool$update_mob_id
bool$blob_null
Returns
array

Definition at line 114 of file class.ilDatabaseCommonTestMockData.php.

115 {
116 $fields = array(
117 'id' => array(
118 'integer',
119 56,
120 ),
121 'is_online' => array(
122 'integer',
123 true,
124 ),
125 'is_default' => array(
126 'integer',
127 false,
128 ),
129 'latitude' => array(
130 'float',
131 47.059830,
132 ),
133 'longitude' => array(
134 'float',
135 7.624028,
136 ),
137 'elevation' => array(
138 'float',
139 2.56,
140 ),
141 'address' => array(
142 'text',
143 'Farbweg 9, 3400 Burgdorf',
144 ),
145 'init_mob_id' => array(
146 'integer',
147 $update_mob_id ? $update_mob_id : 78,
148 ),
149 'comment_mob_id' => array(
150 'integer',
151 69,
152 ),
153 'container_id' => array(
154 'integer',
155 456,
156 ),
157 );
158 if ($with_clob) {
159 $fields['big_data'] = array(
160 'clob',
161 $blob_null ? null : 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.',
162 );
163 }
164
165 return $fields;
166 }

◆ getInputArrayForTransaction()

ilDatabaseCommonTestMockData::getInputArrayForTransaction ( )
Returns
array

Definition at line 172 of file class.ilDatabaseCommonTestMockData.php.

173 {
174 $fields = array(
175 'id' => array(
176 'integer',
177 123456,
178 ),
179 'is_online' => array(
180 'integer',
181 true,
182 ),
183 'is_default' => array(
184 'integer',
185 false,
186 ),
187 );
188
189 return $fields;
190 }

◆ getInsertQuery()

ilDatabaseCommonTestMockData::getInsertQuery (   $table_name)
abstract
Parameters
$table_name
Returns
string

Reimplemented in ilDatabaseMySQLTestMockData, and ilDatabasePostgresTestMockData.

◆ getLike()

ilDatabaseCommonTestMockData::getLike ( )
Returns
string

Definition at line 23 of file class.ilDatabaseCommonTestMockData.php.

24 {
25 return " UPPER(column) LIKE(UPPER('22'))";
26 }

◆ getLocate()

ilDatabaseCommonTestMockData::getLocate ( )
Returns
string

Definition at line 32 of file class.ilDatabaseCommonTestMockData.php.

33 {
34 return " LOCATE( needle,mystring,5) ";
35 }

◆ getNow()

ilDatabaseCommonTestMockData::getNow ( )
Returns
string

Reimplemented in ilDatabasePostgresTestMockData.

Definition at line 14 of file class.ilDatabaseCommonTestMockData.php.

15 {
16 return "NOW()";
17 }

◆ getTableCreateSQL()

ilDatabaseCommonTestMockData::getTableCreateSQL (   $tablename,
  $engine 
)
Returns
mixed

Definition at line 203 of file class.ilDatabaseCommonTestMockData.php.

204 {
205 return "CREATE TABLE `" . $tablename . "` (
206 `id` int(11) NOT NULL,
207 `is_online` tinyint(4) DEFAULT NULL,
208 `is_default` tinyint(4) DEFAULT '1',
209 `latitude` double DEFAULT NULL,
210 `longitude` double DEFAULT NULL,
211 `elevation` double DEFAULT NULL,
212 `address` varchar(256) DEFAULT NULL,
213 `init_mob_id` int(11) DEFAULT NULL,
214 `comment_mob_id` int(11) DEFAULT NULL,
215 `container_id` int(11) DEFAULT NULL,
216 `big_data` longtext,
217 PRIMARY KEY (`id`)) ENGINE=$engine DEFAULT CHARSET=utf8";
218 }

◆ getTableCreateSQLAfterAlter()

ilDatabaseCommonTestMockData::getTableCreateSQLAfterAlter (   $tablename,
  $engine,
  $supports_fulltext 
)
Returns
mixed

Definition at line 250 of file class.ilDatabaseCommonTestMockData.php.

251 {
252 $add_idex = '';
253 if ($supports_fulltext) {
254 $add_idex = ", FULLTEXT KEY `i2_idx` (`address`)";
255 }
256
257 return "CREATE TABLE `" . $tablename . "` (
258 `id` int(11) NOT NULL,
259 `is_online` tinyint(4) DEFAULT NULL,
260 `is_default` tinyint(4) DEFAULT '1',
261 `latitude` double DEFAULT NULL,
262 `longitude` double DEFAULT NULL,
263 `elevation` double DEFAULT NULL,
264 `address` varchar(256) DEFAULT NULL,
265 `init_mob_id` int(11) DEFAULT NULL,
266 `comment_mob_id_altered` varchar(250) DEFAULT NULL,
267 `container_id` int(11) DEFAULT NULL,
268 `big_data` longtext,
269 PRIMARY KEY (`id`), KEY `i1_idx` (`init_mob_id`)$add_idex) ENGINE=$engine DEFAULT CHARSET=utf8";
270 }

◆ getTableCreateSQLAfterRename()

ilDatabaseCommonTestMockData::getTableCreateSQLAfterRename (   $tablename,
  $engine,
  $supports_fulltext 
)
Returns
mixed

Definition at line 224 of file class.ilDatabaseCommonTestMockData.php.

225 {
226 $add_idex = '';
227 if ($supports_fulltext) {
228 $add_idex = ", FULLTEXT KEY `i2_idx` (`address`)";
229 }
230
231 return "CREATE TABLE `" . $tablename . "` (
232 `id` int(11) NOT NULL,
233 `is_online` tinyint(4) DEFAULT NULL,
234 `is_default` tinyint(4) DEFAULT '1',
235 `latitude` double DEFAULT NULL,
236 `longitude` double DEFAULT NULL,
237 `elevation` double DEFAULT NULL,
238 `address` varchar(256) DEFAULT NULL,
239 `init_mob_id` int(11) DEFAULT NULL,
240 `comment_mob_id_altered` int(11) DEFAULT NULL,
241 `container_id` int(11) DEFAULT NULL,
242 `big_data` longtext,
243 PRIMARY KEY (`id`), KEY `i1_idx` (`init_mob_id`)$add_idex) ENGINE=$engine DEFAULT CHARSET=utf8";
244 }

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