Passed
Push — master ( 8673f8...5c56ce )
by Aimeos
04:42
created

Standard::find()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 5
dl 0
loc 4
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), 2015-2024
6
 * @package MShop
7
 * @subpackage Service
8
 */
9
10
11
namespace Aimeos\MShop\Service\Manager;
12
13
14
/**
15
 * Delivery and payment service manager.
16
 *
17
 * @package MShop
18
 * @subpackage Service
19
 */
20
class Standard
21
	extends \Aimeos\MShop\Service\Manager\Base
22
	implements \Aimeos\MShop\Service\Manager\Iface, \Aimeos\MShop\Common\Manager\Factory\Iface
23
{
24
	/**
25
	 * Creates a new empty item instance
26
	 *
27
	 * @param array $values Values the item should be initialized with
28
	 * @return \Aimeos\MShop\Service\Item\Iface New service item object
29
	 */
30
	public function create( array $values = [] ) : \Aimeos\MShop\Common\Item\Iface
31
	{
32
		$context = $this->context();
33
34
		$values['.date'] = $context->datetime();
35
		$values['service.siteid'] = $values['service.siteid'] ?? $context->locale()->getSiteId();
36
37
		return new \Aimeos\MShop\Service\Item\Standard( 'service.', $values );
38
	}
39
40
41
	/**
42
	 * Removes multiple items.
43
	 *
44
	 * @param \Aimeos\MShop\Common\Item\Iface[]|string[] $items List of item objects or IDs of the items
45
	 * @return \Aimeos\MShop\Service\Manager\Iface Manager object for chaining method calls
46
	 */
47
	public function delete( $items ) : \Aimeos\MShop\Common\Manager\Iface
48
	{
49
		return parent::delete( $items )->deleteRefItems( $items );
50
	}
51
52
53
	/**
54
	 * Creates a filter object.
55
	 *
56
	 * @param bool|null $default Add default criteria or NULL for relaxed default criteria
57
	 * @param bool $site TRUE for adding site criteria to limit items by the site of related items
58
	 * @return \Aimeos\Base\Criteria\Iface Returns the filter object
59
	 */
60
	public function filter( ?bool $default = false, bool $site = false ) : \Aimeos\Base\Criteria\Iface
61
	{
62
		$filter = $this->filterBase( 'service', $default );
63
64
		if( $default !== false )
65
		{
66
			$date = $this->context()->datetime();
67
68
			$filter->setConditions( $filter->and( [
69
				$filter->or( [
70
					$filter->compare( '<=', 'service.datestart', $date ),
71
					$filter->compare( '==', 'service.datestart', null ),
72
				] ),
73
				$filter->or( [
74
					$filter->compare( '>=', 'service.dateend', $date ),
75
					$filter->compare( '==', 'service.dateend', null ),
76
				] ),
77
			] ) );
78
		}
79
80
		return $filter;
81
	}
82
83
84
	/**
85
	 * Returns the item specified by its code and domain/type if necessary
86
	 *
87
	 * @param string $code Code of the item
88
	 * @param string[] $ref List of domains to fetch list items and referenced items for
89
	 * @param string|null $domain Domain of the item if necessary to identify the item uniquely
90
	 * @param string|null $type Type code of the item if necessary to identify the item uniquely
91
	 * @param bool|null $default Add default criteria or NULL for relaxed default criteria
92
	 * @return \Aimeos\MShop\Common\Item\Iface Item object
93
	 */
94
	public function find( string $code, array $ref = [], string $domain = null, string $type = null,
95
		?bool $default = false ) : \Aimeos\MShop\Common\Item\Iface
96
	{
97
		return $this->findBase( ['service.code' => $code], $ref, $default );
98
	}
99
100
101
	/**
102
	 * Returns the additional column/search definitions
103
	 *
104
	 * @return array Associative list of column names as keys and items implementing \Aimeos\Base\Criteria\Attribute\Iface
105
	 */
106
	public function getSaveAttributes() : array
107
	{
108
		return $this->createAttributes( [
109
			'service.type' => [
110
				'label' => 'Type',
111
				'internalcode' => 'type',
112
			],
113
			'service.label' => [
114
				'label' => 'Label',
115
				'internalcode' => 'label',
116
			],
117
			'service.code' => [
118
				'label' => 'Code',
119
				'internalcode' => 'code',
120
			],
121
			'service.provider' => [
122
				'label' => 'Provider',
123
				'internalcode' => 'provider',
124
			],
125
			'service.datestart' => [
126
				'label' => 'Start date/time',
127
				'internalcode' => 'start',
128
				'type' => 'datetime',
129
			],
130
			'service.dateend' => [
131
				'label' => 'End date/time',
132
				'internalcode' => 'end',
133
				'type' => 'datetime',
134
			],
135
			'service.position' => [
136
				'label' => 'Position',
137
				'internalcode' => 'pos',
138
				'type' => 'int',
139
			],
140
			'service.status' => [
141
				'label' => 'Status',
142
				'internalcode' => 'status',
143
				'type' => 'int',
144
			],
145
			'service.config' => [
146
				'label' => 'Configuration',
147
				'internalcode' => 'config',
148
				'type' => 'json',
149
				'public' => false,
150
			],
151
		] );
152
	}
153
154
155
	/**
156
	 * Returns the attributes that can be used for searching.
157
	 *
158
	 * @param bool $withsub Return also attributes of sub-managers if true
159
	 * @return \Aimeos\Base\Criteria\Attribute\Iface[] List of search attribute items
160
	 */
161
	public function getSearchAttributes( bool $withsub = true ) : array
162
	{
163
		$level = \Aimeos\MShop\Locale\Manager\Base::SITE_ALL;
164
		$level = $this->context()->config()->get( 'mshop/service/manager/sitemode', $level );
165
166
		return array_replace( parent::getSearchAttributes( $withsub ), $this->createAttributes( [
167
			'service:has' => array(
168
				'code' => 'service:has()',
169
				'internalcode' => ':site AND :key AND mserli."id"',
170
				'internaldeps' => ['LEFT JOIN "mshop_service_list" AS mserli ON ( mserli."parentid" = mser."id" )'],
171
				'label' => 'Service has list item, parameter(<domain>[,<list type>[,<reference ID>)]]',
172
				'type' => 'null',
173
				'public' => false,
174
				'function' => function( &$source, array $params ) use ( $level ) {
175
					$keys = [];
176
177
					foreach( (array) ( $params[1] ?? '' ) as $type ) {
178
						foreach( (array) ( $params[2] ?? '' ) as $id ) {
179
							$keys[] = $params[0] . '|' . ( $type ? $type . '|' : '' ) . $id;
180
						}
181
					}
182
183
					$sitestr = $this->siteString( 'mserli."siteid"', $level );
184
					$keystr = $this->toExpression( 'mserli."key"', $keys, ( $params[2] ?? null ) ? '==' : '=~' );
185
					$source = str_replace( [':site', ':key'], [$sitestr, $keystr], $source );
186
187
					return $params;
188
				}
189
			),
190
		] ) );
191
	}
192
193
194
	/**
195
	 * Saves the dependent items of the item
196
	 *
197
	 * @param \Aimeos\MShop\Common\Item\Iface $item Item object
198
	 * @param bool $fetch True if the new ID should be returned in the item
199
	 * @return \Aimeos\MShop\Common\Item\Iface Updated item
200
	 */
201
	public function saveRefs( \Aimeos\MShop\Common\Item\Iface $item, bool $fetch = true ) : \Aimeos\MShop\Common\Item\Iface
202
	{
203
		return $this->saveListItems( $item, 'service', $fetch );
204
	}
205
206
207
	/**
208
	 * Merges the data from the given map and the referenced items
209
	 *
210
	 * @param array $entries Associative list of ID as key and the associative list of property key/value pairs as values
211
	 * @param array $ref List of referenced items to fetch and add to the entries
212
	 * @return array Associative list of ID as key and the updated entries as value
213
	 */
214
	public function searchRefs( array $entries, array $ref ) : array
215
	{
216
		$parentIds = array_keys( $entries );
217
218
		foreach( $this->getListItems( $parentIds, $ref, 'service' ) as $id => $listItem ) {
219
			$entries[$listItem->getParentId()]['.listitems'][$id] = $listItem;
220
		}
221
222
		return $entries;
223
	}
224
225
226
	/**
227
	 * Returns the prefix for the item properties and search keys.
228
	 *
229
	 * @return string Prefix for the item properties and search keys
230
	 */
231
	protected function prefix() : string
232
	{
233
		return 'service.';
234
	}
235
236
237
	/** mshop/service/manager/resource
238
	 * Name of the database connection resource to use
239
	 *
240
	 * You can configure a different database connection for each data domain
241
	 * and if no such connection name exists, the "db" connection will be used.
242
	 * It's also possible to use the same database connection for different
243
	 * data domains by configuring the same connection name using this setting.
244
	 *
245
	 * @param string Database connection name
246
	 * @since 2023.04
247
	 */
248
249
	/** mshop/service/manager/name
250
	 * Class name of the used service manager implementation
251
	 *
252
	 * Each default manager can be replace by an alternative imlementation.
253
	 * To use this implementation, you have to set the last part of the class
254
	 * name as configuration value so the manager factory knows which class it
255
	 * has to instantiate.
256
	 *
257
	 * For example, if the name of the default class is
258
	 *
259
	 *  \Aimeos\MShop\Service\Manager\Standard
260
	 *
261
	 * and you want to replace it with your own version named
262
	 *
263
	 *  \Aimeos\MShop\Service\Manager\Mymanager
264
	 *
265
	 * then you have to set the this configuration option:
266
	 *
267
	 *  mshop/service/manager/name = Mymanager
268
	 *
269
	 * The value is the last part of your own class name and it's case sensitive,
270
	 * so take care that the configuration value is exactly named like the last
271
	 * part of the class name.
272
	 *
273
	 * The allowed characters of the class name are A-Z, a-z and 0-9. No other
274
	 * characters are possible! You should always start the last part of the class
275
	 * name with an upper case character and continue only with lower case characters
276
	 * or numbers. Avoid chamel case names like "MyManager"!
277
	 *
278
	 * @param string Last part of the class name
279
	 * @since 2014.03
280
	 */
281
282
	/** mshop/service/manager/decorators/excludes
283
	 * Excludes decorators added by the "common" option from the service manager
284
	 *
285
	 * Decorators extend the functionality of a class by adding new aspects
286
	 * (e.g. log what is currently done), executing the methods of the underlying
287
	 * class only in certain conditions (e.g. only for logged in users) or
288
	 * modify what is returned to the caller.
289
	 *
290
	 * This option allows you to remove a decorator added via
291
	 * "mshop/common/manager/decorators/default" before they are wrapped
292
	 * around the service manager.
293
	 *
294
	 *  mshop/service/manager/decorators/excludes = array( 'decorator1' )
295
	 *
296
	 * This would remove the decorator named "decorator1" from the list of
297
	 * common decorators ("\Aimeos\MShop\Common\Manager\Decorator\*") added via
298
	 * "mshop/common/manager/decorators/default" for the service manager.
299
	 *
300
	 * @param array List of decorator names
301
	 * @since 2014.03
302
	 * @see mshop/common/manager/decorators/default
303
	 * @see mshop/service/manager/decorators/global
304
	 * @see mshop/service/manager/decorators/local
305
	 */
306
307
	/** mshop/service/manager/decorators/global
308
	 * Adds a list of globally available decorators only to the service manager
309
	 *
310
	 * Decorators extend the functionality of a class by adding new aspects
311
	 * (e.g. log what is currently done), executing the methods of the underlying
312
	 * class only in certain conditions (e.g. only for logged in users) or
313
	 * modify what is returned to the caller.
314
	 *
315
	 * This option allows you to wrap global decorators
316
	 * ("\Aimeos\MShop\Common\Manager\Decorator\*") around the service manager.
317
	 *
318
	 *  mshop/service/manager/decorators/global = array( 'decorator1' )
319
	 *
320
	 * This would add the decorator named "decorator1" defined by
321
	 * "\Aimeos\MShop\Common\Manager\Decorator\Decorator1" only to the service
322
	 * manager.
323
	 *
324
	 * @param array List of decorator names
325
	 * @since 2014.03
326
	 * @see mshop/common/manager/decorators/default
327
	 * @see mshop/service/manager/decorators/excludes
328
	 * @see mshop/service/manager/decorators/local
329
	 */
330
331
	/** mshop/service/manager/decorators/local
332
	 * Adds a list of local decorators only to the service manager
333
	 *
334
	 * Decorators extend the functionality of a class by adding new aspects
335
	 * (e.g. log what is currently done), executing the methods of the underlying
336
	 * class only in certain conditions (e.g. only for logged in users) or
337
	 * modify what is returned to the caller.
338
	 *
339
	 * This option allows you to wrap local decorators
340
	 * ("\Aimeos\MShop\Service\Manager\Decorator\*") around the service manager.
341
	 *
342
	 *  mshop/service/manager/decorators/local = array( 'decorator2' )
343
	 *
344
	 * This would add the decorator named "decorator2" defined by
345
	 * "\Aimeos\MShop\Service\Manager\Decorator\Decorator2" only to the service
346
	 * manager.
347
	 *
348
	 * @param array List of decorator names
349
	 * @since 2014.03
350
	 * @see mshop/common/manager/decorators/default
351
	 * @see mshop/service/manager/decorators/excludes
352
	 * @see mshop/service/manager/decorators/global
353
	 */
354
355
	/** mshop/service/manager/submanagers
356
	 * List of manager names that can be instantiated by the service manager
357
	 *
358
	 * Managers provide a generic interface to the underlying storage.
359
	 * Each manager has or can have sub-managers caring about particular
360
	 * aspects. Each of these sub-managers can be instantiated by its
361
	 * parent manager using the getSubManager() method.
362
	 *
363
	 * The search keys from sub-managers can be normally used in the
364
	 * manager as well. It allows you to search for items of the manager
365
	 * using the search keys of the sub-managers to further limit the
366
	 * retrieved list of items.
367
	 *
368
	 * @param array List of sub-manager names
369
	 * @since 2014.03
370
	 */
371
372
	/** mshop/service/manager/delete/mysql
373
	 * Deletes the items matched by the given IDs from the database
374
	 *
375
	 * @see mshop/service/manager/delete/ansi
376
	 */
377
378
	/** mshop/service/manager/delete/ansi
379
	 * Deletes the items matched by the given IDs from the database
380
	 *
381
	 * Removes the records specified by the given IDs from the service database.
382
	 * The records must be from the site that is configured via the
383
	 * context item.
384
	 *
385
	 * The ":cond" placeholder is replaced by the name of the ID column and
386
	 * the given ID or list of IDs while the site ID is bound to the question
387
	 * mark.
388
	 *
389
	 * The SQL statement should conform to the ANSI standard to be
390
	 * compatible with most relational database systems. This also
391
	 * includes using double quotes for table and column names.
392
	 *
393
	 * @param string SQL statement for deleting items
394
	 * @since 2014.03
395
	 * @see mshop/service/manager/insert/ansi
396
	 * @see mshop/service/manager/update/ansi
397
	 * @see mshop/service/manager/newid/ansi
398
	 * @see mshop/service/manager/search/ansi
399
	 * @see mshop/service/manager/count/ansi
400
	 */
401
402
	/** mshop/service/manager/insert/mysql
403
	 * Inserts a new service record into the database table
404
	 *
405
	 * @see mshop/service/manager/insert/ansi
406
	 */
407
408
	/** mshop/service/manager/insert/ansi
409
	 * Inserts a new service record into the database table
410
	 *
411
	 * Items with no ID yet (i.e. the ID is NULL) will be created in
412
	 * the database and the newly created ID retrieved afterwards
413
	 * using the "newid" SQL statement.
414
	 *
415
	 * The SQL statement must be a string suitable for being used as
416
	 * prepared statement. It must include question marks for binding
417
	 * the values from the service item to the statement before they are
418
	 * sent to the database server. The number of question marks must
419
	 * be the same as the number of columns listed in the INSERT
420
	 * statement. The order of the columns must correspond to the
421
	 * order in the save() method, so the correct values are
422
	 * bound to the columns.
423
	 *
424
	 * The SQL statement should conform to the ANSI standard to be
425
	 * compatible with most relational database systems. This also
426
	 * includes using double quotes for table and column names.
427
	 *
428
	 * @param string SQL statement for inserting records
429
	 * @since 2014.03
430
	 * @see mshop/service/manager/update/ansi
431
	 * @see mshop/service/manager/newid/ansi
432
	 * @see mshop/service/manager/delete/ansi
433
	 * @see mshop/service/manager/search/ansi
434
	 * @see mshop/service/manager/count/ansi
435
	 */
436
437
	/** mshop/service/manager/update/mysql
438
	 * Updates an existing service record in the database
439
	 *
440
	 * @see mshop/service/manager/update/ansi
441
	 */
442
443
	/** mshop/service/manager/update/ansi
444
	 * Updates an existing service record in the database
445
	 *
446
	 * Items which already have an ID (i.e. the ID is not NULL) will
447
	 * be updated in the database.
448
	 *
449
	 * The SQL statement must be a string suitable for being used as
450
	 * prepared statement. It must include question marks for binding
451
	 * the values from the service item to the statement before they are
452
	 * sent to the database server. The order of the columns must
453
	 * correspond to the order in the save() method, so the
454
	 * correct values are bound to the columns.
455
	 *
456
	 * The SQL statement should conform to the ANSI standard to be
457
	 * compatible with most relational database systems. This also
458
	 * includes using double quotes for table and column names.
459
	 *
460
	 * @param string SQL statement for updating records
461
	 * @since 2014.03
462
	 * @see mshop/service/manager/insert/ansi
463
	 * @see mshop/service/manager/newid/ansi
464
	 * @see mshop/service/manager/delete/ansi
465
	 * @see mshop/service/manager/search/ansi
466
	 * @see mshop/service/manager/count/ansi
467
	 */
468
469
	/** mshop/service/manager/newid/mysql
470
	 * Retrieves the ID generated by the database when inserting a new record
471
	 *
472
	 * @see mshop/service/manager/newid/ansi
473
	 */
474
475
	/** mshop/service/manager/newid/ansi
476
	 * Retrieves the ID generated by the database when inserting a new record
477
	 *
478
	 * As soon as a new record is inserted into the database table,
479
	 * the database server generates a new and unique identifier for
480
	 * that record. This ID can be used for retrieving, updating and
481
	 * deleting that specific record from the table again.
482
	 *
483
	 * For MySQL:
484
	 *  SELECT LAST_INSERT_ID()
485
	 * For PostgreSQL:
486
	 *  SELECT currval('seq_mser_id')
487
	 * For SQL Server:
488
	 *  SELECT SCOPE_IDENTITY()
489
	 * For Oracle:
490
	 *  SELECT "seq_mser_id".CURRVAL FROM DUAL
491
	 *
492
	 * There's no way to retrive the new ID by a SQL statements that
493
	 * fits for most database servers as they implement their own
494
	 * specific way.
495
	 *
496
	 * @param string SQL statement for retrieving the last inserted record ID
497
	 * @since 2014.03
498
	 * @see mshop/service/manager/insert/ansi
499
	 * @see mshop/service/manager/update/ansi
500
	 * @see mshop/service/manager/delete/ansi
501
	 * @see mshop/service/manager/search/ansi
502
	 * @see mshop/service/manager/count/ansi
503
	 */
504
505
	/** mshop/service/manager/sitemode
506
	 * Mode how items from levels below or above in the site tree are handled
507
	 *
508
	 * By default, only items from the current site are fetched from the
509
	 * storage. If the ai-sites extension is installed, you can create a
510
	 * tree of sites. Then, this setting allows you to define for the
511
	 * whole service domain if items from parent sites are inherited,
512
	 * sites from child sites are aggregated or both.
513
	 *
514
	 * Available constants for the site mode are:
515
	 * * 0 = only items from the current site
516
	 * * 1 = inherit items from parent sites
517
	 * * 2 = aggregate items from child sites
518
	 * * 3 = inherit and aggregate items at the same time
519
	 *
520
	 * You also need to set the mode in the locale manager
521
	 * (mshop/locale/manager/sitelevel) to one of the constants.
522
	 * If you set it to the same value, it will work as described but you
523
	 * can also use different modes. For example, if inheritance and
524
	 * aggregation is configured the locale manager but only inheritance
525
	 * in the domain manager because aggregating items makes no sense in
526
	 * this domain, then items wil be only inherited. Thus, you have full
527
	 * control over inheritance and aggregation in each domain.
528
	 *
529
	 * @param int Constant from Aimeos\MShop\Locale\Manager\Base class
530
	 * @since 2018.01
531
	 * @see mshop/locale/manager/sitelevel
532
	 */
533
534
	/** mshop/service/manager/search/mysql
535
	 * Retrieves the records matched by the given criteria in the database
536
	 *
537
	 * @see mshop/service/manager/search/ansi
538
	 */
539
540
	/** mshop/service/manager/search/ansi
541
	 * Retrieves the records matched by the given criteria in the database
542
	 *
543
	 * Fetches the records matched by the given criteria from the service
544
	 * database. The records must be from one of the sites that are
545
	 * configured via the context item. If the current site is part of
546
	 * a tree of sites, the SELECT statement can retrieve all records
547
	 * from the current site and the complete sub-tree of sites.
548
	 *
549
	 * As the records can normally be limited by criteria from sub-managers,
550
	 * their tables must be joined in the SQL context. This is done by
551
	 * using the "internaldeps" property from the definition of the ID
552
	 * column of the sub-managers. These internal dependencies specify
553
	 * the JOIN between the tables and the used columns for joining. The
554
	 * ":joins" placeholder is then replaced by the JOIN strings from
555
	 * the sub-managers.
556
	 *
557
	 * To limit the records matched, conditions can be added to the given
558
	 * criteria object. It can contain comparisons like column names that
559
	 * must match specific values which can be combined by AND, OR or NOT
560
	 * operators. The resulting string of SQL conditions replaces the
561
	 * ":cond" placeholder before the statement is sent to the database
562
	 * server.
563
	 *
564
	 * If the records that are retrieved should be ordered by one or more
565
	 * columns, the generated string of column / sort direction pairs
566
	 * replaces the ":order" placeholder. Columns of
567
	 * sub-managers can also be used for ordering the result set but then
568
	 * no index can be used.
569
	 *
570
	 * The number of returned records can be limited and can start at any
571
	 * number between the begining and the end of the result set. For that
572
	 * the ":size" and ":start" placeholders are replaced by the
573
	 * corresponding values from the criteria object. The default values
574
	 * are 0 for the start and 100 for the size value.
575
	 *
576
	 * The SQL statement should conform to the ANSI standard to be
577
	 * compatible with most relational database systems. This also
578
	 * includes using double quotes for table and column names.
579
	 *
580
	 * @param string SQL statement for searching items
581
	 * @since 2014.03
582
	 * @see mshop/service/manager/insert/ansi
583
	 * @see mshop/service/manager/update/ansi
584
	 * @see mshop/service/manager/newid/ansi
585
	 * @see mshop/service/manager/delete/ansi
586
	 * @see mshop/service/manager/count/ansi
587
	 */
588
589
	/** mshop/service/manager/count/mysql
590
	 * Counts the number of records matched by the given criteria in the database
591
	 *
592
	 * @see mshop/service/manager/count/ansi
593
	 */
594
595
	/** mshop/service/manager/count/ansi
596
	 * Counts the number of records matched by the given criteria in the database
597
	 *
598
	 * Counts all records matched by the given criteria from the service
599
	 * database. The records must be from one of the sites that are
600
	 * configured via the context item. If the current site is part of
601
	 * a tree of sites, the statement can count all records from the
602
	 * current site and the complete sub-tree of sites.
603
	 *
604
	 * As the records can normally be limited by criteria from sub-managers,
605
	 * their tables must be joined in the SQL context. This is done by
606
	 * using the "internaldeps" property from the definition of the ID
607
	 * column of the sub-managers. These internal dependencies specify
608
	 * the JOIN between the tables and the used columns for joining. The
609
	 * ":joins" placeholder is then replaced by the JOIN strings from
610
	 * the sub-managers.
611
	 *
612
	 * To limit the records matched, conditions can be added to the given
613
	 * criteria object. It can contain comparisons like column names that
614
	 * must match specific values which can be combined by AND, OR or NOT
615
	 * operators. The resulting string of SQL conditions replaces the
616
	 * ":cond" placeholder before the statement is sent to the database
617
	 * server.
618
	 *
619
	 * Both, the strings for ":joins" and for ":cond" are the same as for
620
	 * the "search" SQL statement.
621
	 *
622
	 * Contrary to the "search" statement, it doesn't return any records
623
	 * but instead the number of records that have been found. As counting
624
	 * thousands of records can be a long running task, the maximum number
625
	 * of counted records is limited for performance reasons.
626
	 *
627
	 * The SQL statement should conform to the ANSI standard to be
628
	 * compatible with most relational database systems. This also
629
	 * includes using double quotes for table and column names.
630
	 *
631
	 * @param string SQL statement for counting items
632
	 * @since 2014.03
633
	 * @see mshop/service/manager/insert/ansi
634
	 * @see mshop/service/manager/update/ansi
635
	 * @see mshop/service/manager/newid/ansi
636
	 * @see mshop/service/manager/delete/ansi
637
	 * @see mshop/service/manager/search/ansi
638
	 */
639
}
640