Passed
Push — master ( 873a62...e4a92d )
by Aimeos
04:13
created

Standard::clear()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

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