ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 37 of file class.ilDatabaseCommonTestMockData.php.

37  {
38  if ($allow_null) {
39  return " CONCAT(COALESCE(o,''),COALESCE(t,''),COALESCE(t,'')) ";
40  }else {
41  return " CONCAT(o,t,t) ";
42  }
43  }

◆ getDBFields()

ilDatabaseCommonTestMockData::getDBFields ( )
Returns
array

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

References array.

49  {
50  $fields = array(
51  'id' => array(
52  'type' => 'integer',
53  'length' => 4,
54  'notnull' => true,
55  ),
56  'is_online' => array(
57  'type' => 'integer',
58  'length' => 1,
59  'notnull' => false,
60  ),
61  'is_default' => array(
62  'type' => 'integer',
63  'length' => 1,
64  'notnull' => false,
65  'default' => 1,
66  ),
67  'latitude' => array(
68  'type' => 'float',
69  ),
70  'longitude' => array(
71  'type' => 'float',
72  ),
73  'elevation' => array(
74  'type' => 'float',
75  ),
76  'address' => array(
77  'type' => 'text',
78  'length' => 256,
79  'notnull' => false,
80  ),
81  'init_mob_id' => array(
82  'type' => 'integer',
83  'length' => 4,
84  'notnull' => false,
85  ),
86  'comment_mob_id' => array(
87  'type' => 'integer',
88  'length' => 4,
89  ),
90  'container_id' => array(
91  'type' => 'integer',
92  'length' => 4,
93  ),
94  'big_data' => array(
95  'type' => 'clob',
96  ),
97  );
98 
99  return $fields;
100  }
Create styles array
The data for the language used.

◆ 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 108 of file class.ilDatabaseCommonTestMockData.php.

References array.

108  {
109  $fields = array(
110  'id' => array(
111  'integer',
112  56,
113  ),
114  'is_online' => array(
115  'integer',
116  true,
117  ),
118  'is_default' => array(
119  'integer',
120  false,
121  ),
122  'latitude' => array(
123  'float',
124  47.059830,
125  ),
126  'longitude' => array(
127  'float',
128  7.624028,
129  ),
130  'elevation' => array(
131  'float',
132  2.56,
133  ),
134  'address' => array(
135  'text',
136  'Farbweg 9, 3400 Burgdorf',
137  ),
138  'init_mob_id' => array(
139  'integer',
140  $update_mob_id ? $update_mob_id : 78,
141  ),
142  'comment_mob_id' => array(
143  'integer',
144  69,
145  ),
146  'container_id' => array(
147  'integer',
148  456,
149  ),
150  );
151  if ($with_clob) {
152  $fields['big_data'] = array(
153  'clob',
154  $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.',
155  );
156  }
157 
158  return $fields;
159  }
Create styles array
The data for the language used.

◆ getInputArrayForTransaction()

ilDatabaseCommonTestMockData::getInputArrayForTransaction ( )
Returns
array

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

References array, and getInsertQuery().

165  {
166  $fields = array(
167  'id' => array(
168  'integer',
169  123456,
170  ),
171  'is_online' => array(
172  'integer',
173  true,
174  ),
175  'is_default' => array(
176  'integer',
177  false,
178  ),
179  );
180 
181  return $fields;
182  }
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ getInsertQuery()

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

Referenced by getInputArrayForTransaction().

+ Here is the caller graph for this function:

◆ getLike()

ilDatabaseCommonTestMockData::getLike ( )
Returns
string

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

21  {
22  return " UPPER(column) LIKE(UPPER('22'))";
23  }

◆ getLocate()

ilDatabaseCommonTestMockData::getLocate ( )
Returns
string

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

29  {
30  return " LOCATE( needle,mystring,5) ";
31  }

◆ getNow()

ilDatabaseCommonTestMockData::getNow ( )
Returns
string

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

13  {
14  return "NOW()";
15  }

◆ getTableCreateSQL()

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

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

195  {
196  return "CREATE TABLE `" . $tablename . "` (
197  `id` int(11) NOT NULL,
198  `is_online` tinyint(4) DEFAULT NULL,
199  `is_default` tinyint(4) DEFAULT '1',
200  `latitude` double DEFAULT NULL,
201  `longitude` double DEFAULT NULL,
202  `elevation` double DEFAULT NULL,
203  `address` varchar(256) DEFAULT NULL,
204  `init_mob_id` int(11) DEFAULT NULL,
205  `comment_mob_id` int(11) DEFAULT NULL,
206  `container_id` int(11) DEFAULT NULL,
207  `big_data` longtext,
208  PRIMARY KEY (`id`)) ENGINE=$engine DEFAULT CHARSET=utf8";
209  }

◆ getTableCreateSQLAfterAlter()

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

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

240  {
241  $add_idex = '';
242  if ($supports_fulltext) {
243  $add_idex = ", FULLTEXT KEY `i2_idx` (`address`)";
244  }
245 
246  return "CREATE TABLE `" . $tablename . "` (
247  `id` int(11) NOT NULL,
248  `is_online` tinyint(4) DEFAULT NULL,
249  `is_default` tinyint(4) DEFAULT '1',
250  `latitude` double DEFAULT NULL,
251  `longitude` double DEFAULT NULL,
252  `elevation` double DEFAULT NULL,
253  `address` varchar(256) DEFAULT NULL,
254  `init_mob_id` int(11) DEFAULT NULL,
255  `comment_mob_id_altered` varchar(250) DEFAULT NULL,
256  `container_id` int(11) DEFAULT NULL,
257  `big_data` longtext,
258  PRIMARY KEY (`id`), KEY `i1_idx` (`init_mob_id`)$add_idex) ENGINE=$engine DEFAULT CHARSET=utf8";
259  }

◆ getTableCreateSQLAfterRename()

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

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

215  {
216  $add_idex = '';
217  if ($supports_fulltext) {
218  $add_idex = ", FULLTEXT KEY `i2_idx` (`address`)";
219  }
220 
221  return "CREATE TABLE `" . $tablename . "` (
222  `id` int(11) NOT NULL,
223  `is_online` tinyint(4) DEFAULT NULL,
224  `is_default` tinyint(4) DEFAULT '1',
225  `latitude` double DEFAULT NULL,
226  `longitude` double DEFAULT NULL,
227  `elevation` double DEFAULT NULL,
228  `address` varchar(256) DEFAULT NULL,
229  `init_mob_id` int(11) DEFAULT NULL,
230  `comment_mob_id_altered` int(11) DEFAULT NULL,
231  `container_id` int(11) DEFAULT NULL,
232  `big_data` longtext,
233  PRIMARY KEY (`id`), KEY `i1_idx` (`init_mob_id`)$add_idex) ENGINE=$engine DEFAULT CHARSET=utf8";
234  }

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