Passed
Push — master ( d4fdb1...98751a )
by Aimeos
31:05 queued 14:19
created

Standard::getSearchConfig()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * @license LGPLv3, https://opensource.org/licenses/LGPL-3.0
5
 * @copyright Aimeos (aimeos.org), 2021-2024
6
 * @package MShop
7
 * @subpackage Cms
8
 */
9
10
11
namespace Aimeos\MShop\Cms\Manager\Lists;
12
13
14
/**
15
 * Default cms list manager for creating and handling cms list items.
16
 * @package MShop
17
 * @subpackage Cms
18
 */
19
class Standard
20
	extends \Aimeos\MShop\Common\Manager\Lists\Base
21
	implements \Aimeos\MShop\Cms\Manager\Lists\Iface, \Aimeos\MShop\Common\Manager\Factory\Iface
22
{
23
	/** madmin/cms/manager/resource
24
	 * Name of the database connection resource to use
25
	 *
26
	 * You can configure a different database connection for each data domain
27
	 * and if no such connection name exists, the "db" connection will be used.
28
	 * It's also possible to use the same database connection for different
29
	 * data domains by configuring the same connection name using this setting.
30
	 *
31
	 * @param string Database connection name
32
	 * @since 2023.04
33
	 */
34
35
	/** mshop/cms/manager/lists/submanagers
36
	 * List of manager names that can be instantiated by the cms list manager
37
	 *
38
	 * Managers provide a generic interface to the underlying storage.
39
	 * Each manager has or can have sub-managers caring about particular
40
	 * aspects. Each of these sub-managers can be instantiated by its
41
	 * parent manager using the getSubManager() method.
42
	 *
43
	 * The search keys from sub-managers can be normally used in the
44
	 * manager as well. It allows you to search for items of the manager
45
	 * using the search keys of the sub-managers to further limit the
46
	 * retrieved list of items.
47
	 *
48
	 * @param array List of sub-manager names
49
	 * @since 2020.10
50
	 * @category Developer
51
	 */
52
53
	/** mshop/cms/manager/lists/name
54
	 * Class name of the used cms list manager implementation
55
	 *
56
	 * Each default cms list manager can be replaced by an alternative imlementation.
57
	 * To use this implementation, you have to set the last part of the class
58
	 * name as configuration value so the manager factory knows which class it
59
	 * has to instantiate.
60
	 *
61
	 * For example, if the name of the default class is
62
	 *
63
	 *  \Aimeos\MShop\Cms\Manager\Lists\Standard
64
	 *
65
	 * and you want to replace it with your own version named
66
	 *
67
	 *  \Aimeos\MShop\Cms\Manager\Lists\Mylist
68
	 *
69
	 * then you have to set the this configuration option:
70
	 *
71
	 *  mshop/cms/manager/lists/name = Mylist
72
	 *
73
	 * The value is the last part of your own class name and it's case sensitive,
74
	 * so take care that the configuration value is exactly named like the last
75
	 * part of the class name.
76
	 *
77
	 * The allowed characters of the class name are A-Z, a-z and 0-9. No other
78
	 * characters are possible! You should always start the last part of the class
79
	 * name with an upper case character and continue only with lower case characters
80
	 * or numbers. Avoid chamel case names like "MyList"!
81
	 *
82
	 * @param string Last part of the class name
83
	 * @since 2020.10
84
	 * @category Developer
85
	 */
86
87
	/** mshop/cms/manager/lists/decorators/excludes
88
	 * Excludes decorators added by the "common" option from the cms list manager
89
	 *
90
	 * Decorators extend the functionality of a class by adding new aspects
91
	 * (e.g. log what is currently done), executing the methods of the underlying
92
	 * class only in certain conditions (e.g. only for logged in users) or
93
	 * modify what is returned to the caller.
94
	 *
95
	 * This option allows you to remove a decorator added via
96
	 * "mshop/common/manager/decorators/default" before they are wrapped
97
	 * around the cms list manager.
98
	 *
99
	 *  mshop/cms/manager/lists/decorators/excludes = array( 'decorator1' )
100
	 *
101
	 * This would remove the decorator named "decorator1" from the list of
102
	 * common decorators ("\Aimeos\MShop\Common\Manager\Decorator\*") added via
103
	 * "mshop/common/manager/decorators/default" for the cms list manager.
104
	 *
105
	 * @param array List of decorator names
106
	 * @since 2020.10
107
	 * @category Developer
108
	 * @see mshop/common/manager/decorators/default
109
	 * @see mshop/cms/manager/lists/decorators/global
110
	 * @see mshop/cms/manager/lists/decorators/local
111
	 */
112
113
	/** mshop/cms/manager/lists/decorators/global
114
	 * Adds a list of globally available decorators only to the cms list manager
115
	 *
116
	 * Decorators extend the functionality of a class by adding new aspects
117
	 * (e.g. log what is currently done), executing the methods of the underlying
118
	 * class only in certain conditions (e.g. only for logged in users) or
119
	 * modify what is returned to the caller.
120
	 *
121
	 * This option allows you to wrap global decorators
122
	 * ("\Aimeos\MShop\Common\Manager\Decorator\*") around the cms list manager.
123
	 *
124
	 *  mshop/cms/manager/lists/decorators/global = array( 'decorator1' )
125
	 *
126
	 * This would add the decorator named "decorator1" defined by
127
	 * "\Aimeos\MShop\Common\Manager\Decorator\Decorator1" only to the cms
128
	 * list manager.
129
	 *
130
	 * @param array List of decorator names
131
	 * @since 2020.10
132
	 * @category Developer
133
	 * @see mshop/common/manager/decorators/default
134
	 * @see mshop/cms/manager/lists/decorators/excludes
135
	 * @see mshop/cms/manager/lists/decorators/local
136
	 */
137
138
	/** mshop/cms/manager/lists/decorators/local
139
	 * Adds a list of local decorators only to the cms list manager
140
	 *
141
	 * Decorators extend the functionality of a class by adding new aspects
142
	 * (e.g. log what is currently done), executing the methods of the underlying
143
	 * class only in certain conditions (e.g. only for logged in users) or
144
	 * modify what is returned to the caller.
145
	 *
146
	 * This option allows you to wrap local decorators
147
	 * ("\Aimeos\MShop\Cms\Manager\Lists\Decorator\*") around the cms list
148
	 * manager.
149
	 *
150
	 *  mshop/cms/manager/lists/decorators/local = array( 'decorator2' )
151
	 *
152
	 * This would add the decorator named "decorator2" defined by
153
	 * "\Aimeos\MShop\Cms\Manager\Lists\Decorator\Decorator2" only to the cms
154
	 * list manager.
155
	 *
156
	 * @param array List of decorator names
157
	 * @since 2020.10
158
	 * @category Developer
159
	 * @see mshop/common/manager/decorators/default
160
	 * @see mshop/cms/manager/lists/decorators/excludes
161
	 * @see mshop/cms/manager/lists/decorators/global
162
	 */
163
164
	/** mshop/cms/manager/lists/insert/mysql
165
	 * Inserts a new cms list record into the database table
166
	 *
167
	 * @see mshop/cms/manager/lists/insert/ansi
168
	 */
169
170
	/** mshop/cms/manager/lists/insert/ansi
171
	 * Inserts a new cms list record into the database table
172
	 *
173
	 * Items with no ID yet (i.e. the ID is NULL) will be created in
174
	 * the database and the newly created ID retrieved afterwards
175
	 * using the "newid" SQL statement.
176
	 *
177
	 * The SQL statement must be a string suitable for being used as
178
	 * prepared statement. It must include question marks for binding
179
	 * the values from the cms list item to the statement before they are
180
	 * sent to the database server. The number of question marks must
181
	 * be the same as the number of columns listed in the INSERT
182
	 * statement. The order of the columns must correspond to the
183
	 * order in the save() method, so the correct values are
184
	 * bound to the columns.
185
	 *
186
	 * The SQL statement should conform to the ANSI standard to be
187
	 * compatible with most relational database systems. This also
188
	 * includes using double quotes for table and column names.
189
	 *
190
	 * @param string SQL statement for inserting records
191
	 * @since 2020.10
192
	 * @category Developer
193
	 * @see mshop/cms/manager/lists/update/ansi
194
	 * @see mshop/cms/manager/lists/newid/ansi
195
	 * @see mshop/cms/manager/lists/delete/ansi
196
	 * @see mshop/cms/manager/lists/search/ansi
197
	 * @see mshop/cms/manager/lists/count/ansi
198
	 * @see mshop/cms/manager/lists/aggregate/ansi
199
	 */
200
201
	/** mshop/cms/manager/lists/update/mysql
202
	 * Updates an existing cms list record in the database
203
	 *
204
	 * @see mshop/cms/manager/lists/update/ansi
205
	 */
206
207
	/** mshop/cms/manager/lists/update/ansi
208
	 * Updates an existing cms list record in the database
209
	 *
210
	 * Items which already have an ID (i.e. the ID is not NULL) will
211
	 * be updated in the database.
212
	 *
213
	 * The SQL statement must be a string suitable for being used as
214
	 * prepared statement. It must include question marks for binding
215
	 * the values from the cms list item to the statement before they are
216
	 * sent to the database server. The order of the columns must
217
	 * correspond to the order in the save() method, so the
218
	 * correct values are bound to the columns.
219
	 *
220
	 * The SQL statement should conform to the ANSI standard to be
221
	 * compatible with most relational database systems. This also
222
	 * includes using double quotes for table and column names.
223
	 *
224
	 * @param string SQL statement for updating records
225
	 * @since 2020.10
226
	 * @category Developer
227
	 * @see mshop/cms/manager/lists/insert/ansi
228
	 * @see mshop/cms/manager/lists/newid/ansi
229
	 * @see mshop/cms/manager/lists/delete/ansi
230
	 * @see mshop/cms/manager/lists/search/ansi
231
	 * @see mshop/cms/manager/lists/count/ansi
232
	 * @see mshop/cms/manager/lists/aggregate/ansi
233
	 */
234
235
	/** mshop/cms/manager/lists/newid/mysql
236
	 * Retrieves the ID generated by the database when inserting a new record
237
	 *
238
	 * @see mshop/cms/manager/lists/newid/ansi
239
	 */
240
241
	/** mshop/cms/manager/lists/newid/ansi
242
	 * Retrieves the ID generated by the database when inserting a new record
243
	 *
244
	 * As soon as a new record is inserted into the database table,
245
	 * the database server generates a new and unique identifier for
246
	 * that record. This ID can be used for retrieving, updating and
247
	 * deleting that specific record from the table again.
248
	 *
249
	 * For MySQL:
250
	 *  SELECT LAST_INSERT_ID()
251
	 * For PostgreSQL:
252
	 *  SELECT currval('seq_mcmsli_id')
253
	 * For SQL Server:
254
	 *  SELECT SCOPE_IDENTITY()
255
	 * For Oracle:
256
	 *  SELECT "seq_mcmsli_id".CURRVAL FROM DUAL
257
	 *
258
	 * There's no way to retrive the new ID by a SQL statements that
259
	 * fits for most database servers as they implement their own
260
	 * specific way.
261
	 *
262
	 * @param string SQL statement for retrieving the last inserted record ID
263
	 * @since 2020.10
264
	 * @category Developer
265
	 * @see mshop/cms/manager/lists/insert/ansi
266
	 * @see mshop/cms/manager/lists/update/ansi
267
	 * @see mshop/cms/manager/lists/delete/ansi
268
	 * @see mshop/cms/manager/lists/search/ansi
269
	 * @see mshop/cms/manager/lists/count/ansi
270
	 * @see mshop/cms/manager/lists/aggregate/ansi
271
	 */
272
273
	/** mshop/cms/manager/lists/delete/mysql
274
	 * Deletes the items matched by the given IDs from the database
275
	 *
276
	 * @see mshop/cms/manager/lists/delete/ansi
277
	 */
278
279
	/** mshop/cms/manager/lists/delete/ansi
280
	 * Deletes the items matched by the given IDs from the database
281
	 *
282
	 * Removes the records specified by the given IDs from the cms database.
283
	 * The records must be from the site that is configured via the
284
	 * context item.
285
	 *
286
	 * The ":cond" placeholder is replaced by the name of the ID column and
287
	 * the given ID or list of IDs while the site ID is bound to the question
288
	 * mark.
289
	 *
290
	 * The SQL statement should conform to the ANSI standard to be
291
	 * compatible with most relational database systems. This also
292
	 * includes using double quotes for table and column names.
293
	 *
294
	 * @param string SQL statement for deleting items
295
	 * @since 2020.10
296
	 * @category Developer
297
	 * @see mshop/cms/manager/lists/insert/ansi
298
	 * @see mshop/cms/manager/lists/update/ansi
299
	 * @see mshop/cms/manager/lists/newid/ansi
300
	 * @see mshop/cms/manager/lists/search/ansi
301
	 * @see mshop/cms/manager/lists/count/ansi
302
	 * @see mshop/cms/manager/lists/aggregate/ansi
303
	 */
304
305
	/** mshop/cms/manager/lists/search/mysql
306
	 * Retrieves the records matched by the given criteria in the database
307
	 *
308
	 * @see mshop/cms/manager/lists/search/ansi
309
	 */
310
311
	/** mshop/cms/manager/lists/search/ansi
312
	 * Retrieves the records matched by the given criteria in the database
313
	 *
314
	 * Fetches the records matched by the given criteria from the cms
315
	 * database. The records must be from one of the sites that are
316
	 * configured via the context item. If the current site is part of
317
	 * a tree of sites, the SELECT statement can retrieve all records
318
	 * from the current site and the complete sub-tree of sites.
319
	 *
320
	 * As the records can normally be limited by criteria from sub-managers,
321
	 * their tables must be joined in the SQL context. This is done by
322
	 * using the "internaldeps" property from the definition of the ID
323
	 * column of the sub-managers. These internal dependencies specify
324
	 * the JOIN between the tables and the used columns for joining. The
325
	 * ":joins" placeholder is then replaced by the JOIN strings from
326
	 * the sub-managers.
327
	 *
328
	 * To limit the records matched, conditions can be added to the given
329
	 * criteria object. It can contain comparisons like column names that
330
	 * must match specific values which can be combined by AND, OR or NOT
331
	 * operators. The resulting string of SQL conditions replaces the
332
	 * ":cond" placeholder before the statement is sent to the database
333
	 * server.
334
	 *
335
	 * If the records that are retrieved should be ordered by one or more
336
	 * columns, the generated string of column / sort direction pairs
337
	 * replaces the ":order" placeholder. In case no ordering is required,
338
	 * the complete ORDER BY part including the "\/*-orderby*\/...\/*orderby-*\/"
339
	 * markers is removed to speed up retrieving the records. Columns of
340
	 * sub-managers can also be used for ordering the result set but then
341
	 * no index can be used.
342
	 *
343
	 * The number of returned records can be limited and can start at any
344
	 * number between the begining and the end of the result set. For that
345
	 * the ":size" and ":start" placeholders are replaced by the
346
	 * corresponding values from the criteria object. The default values
347
	 * are 0 for the start and 100 for the size value.
348
	 *
349
	 * The SQL statement should conform to the ANSI standard to be
350
	 * compatible with most relational database systems. This also
351
	 * includes using double quotes for table and column names.
352
	 *
353
	 * @param string SQL statement for searching items
354
	 * @since 2020.10
355
	 * @category Developer
356
	 * @see mshop/cms/manager/lists/insert/ansi
357
	 * @see mshop/cms/manager/lists/update/ansi
358
	 * @see mshop/cms/manager/lists/newid/ansi
359
	 * @see mshop/cms/manager/lists/delete/ansi
360
	 * @see mshop/cms/manager/lists/count/ansi
361
	 * @see mshop/cms/manager/lists/aggregate/ansi
362
	 */
363
364
	/** mshop/cms/manager/lists/count/mysql
365
	 * Counts the number of records matched by the given criteria in the database
366
	 *
367
	 * @see mshop/cms/manager/lists/count/ansi
368
	 */
369
370
	/** mshop/cms/manager/lists/count/ansi
371
	 * Counts the number of records matched by the given criteria in the database
372
	 *
373
	 * Counts all records matched by the given criteria from the cms
374
	 * database. The records must be from one of the sites that are
375
	 * configured via the context item. If the current site is part of
376
	 * a tree of sites, the statement can count all records from the
377
	 * current site and the complete sub-tree of sites.
378
	 *
379
	 * As the records can normally be limited by criteria from sub-managers,
380
	 * their tables must be joined in the SQL context. This is done by
381
	 * using the "internaldeps" property from the definition of the ID
382
	 * column of the sub-managers. These internal dependencies specify
383
	 * the JOIN between the tables and the used columns for joining. The
384
	 * ":joins" placeholder is then replaced by the JOIN strings from
385
	 * the sub-managers.
386
	 *
387
	 * To limit the records matched, conditions can be added to the given
388
	 * criteria object. It can contain comparisons like column names that
389
	 * must match specific values which can be combined by AND, OR or NOT
390
	 * operators. The resulting string of SQL conditions replaces the
391
	 * ":cond" placeholder before the statement is sent to the database
392
	 * server.
393
	 *
394
	 * Both, the strings for ":joins" and for ":cond" are the same as for
395
	 * the "search" SQL statement.
396
	 *
397
	 * Contrary to the "search" statement, it doesn't return any records
398
	 * but instead the number of records that have been found. As counting
399
	 * thousands of records can be a long running task, the maximum number
400
	 * of counted records is limited for performance reasons.
401
	 *
402
	 * The SQL statement should conform to the ANSI standard to be
403
	 * compatible with most relational database systems. This also
404
	 * includes using double quotes for table and column names.
405
	 *
406
	 * @param string SQL statement for counting items
407
	 * @since 2020.10
408
	 * @category Developer
409
	 * @see mshop/cms/manager/lists/insert/ansi
410
	 * @see mshop/cms/manager/lists/update/ansi
411
	 * @see mshop/cms/manager/lists/newid/ansi
412
	 * @see mshop/cms/manager/lists/delete/ansi
413
	 * @see mshop/cms/manager/lists/search/ansi
414
	 * @see mshop/cms/manager/lists/aggregate/ansi
415
	 */
416
417
	/** mshop/cms/manager/lists/aggregate/mysql
418
	 * Counts the number of records grouped by the values in the key column and matched by the given criteria
419
	 *
420
	 * @see mshop/cms/manager/lists/aggregate/ansi
421
	 */
422
423
	/** mshop/cms/manager/lists/aggregate/ansi
424
	 * Counts the number of records grouped by the values in the key column and matched by the given criteria
425
	 *
426
	 * Groups all records by the values in the key column and counts their
427
	 * occurence. The matched records can be limited by the given criteria
428
	 * from the order database. The records must be from one of the sites
429
	 * that are configured via the context item. If the current site is part
430
	 * of a tree of sites, the statement can count all records from the
431
	 * current site and the complete sub-tree of sites.
432
	 *
433
	 * As the records can normally be limited by criteria from sub-managers,
434
	 * their tables must be joined in the SQL context. This is done by
435
	 * using the "internaldeps" property from the definition of the ID
436
	 * column of the sub-managers. These internal dependencies specify
437
	 * the JOIN between the tables and the used columns for joining. The
438
	 * ":joins" placeholder is then replaced by the JOIN strings from
439
	 * the sub-managers.
440
	 *
441
	 * To limit the records matched, conditions can be added to the given
442
	 * criteria object. It can contain comparisons like column names that
443
	 * must match specific values which can be combined by AND, OR or NOT
444
	 * operators. The resulting string of SQL conditions replaces the
445
	 * ":cond" placeholder before the statement is sent to the database
446
	 * server.
447
	 *
448
	 * This statement doesn't return any records. Instead, it returns pairs
449
	 * of the different values found in the key column together with the
450
	 * number of records that have been found for that key values.
451
	 *
452
	 * The SQL statement should conform to the ANSI standard to be
453
	 * compatible with most relational database systems. This also
454
	 * includes using double quotes for table and column names.
455
	 *
456
	 * @param string SQL statement for aggregating order items
457
	 * @since 2020.10
458
	 * @category Developer
459
	 * @see mshop/cms/manager/lists/insert/ansi
460
	 * @see mshop/cms/manager/lists/update/ansi
461
	 * @see mshop/cms/manager/lists/newid/ansi
462
	 * @see mshop/cms/manager/lists/delete/ansi
463
	 * @see mshop/cms/manager/lists/search/ansi
464
	 * @see mshop/cms/manager/lists/count/ansi
465
	 */
466
}
467