| Total Complexity | 49 |
| Total Lines | 1279 |
| Duplicated Lines | 0 % |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
Complex classes like Standard often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use Standard, and based on these observations, apply Extract Interface, too.
| 1 | <?php |
||
| 21 | class Standard extends Base |
||
| 22 | implements \Aimeos\MShop\Order\Manager\Iface, \Aimeos\MShop\Common\Manager\Factory\Iface |
||
| 23 | { |
||
| 24 | /** mshop/order/manager/name |
||
| 25 | * Class name of the used order manager implementation |
||
| 26 | * |
||
| 27 | * Each default manager can be replace by an alternative imlementation. |
||
| 28 | * To use this implementation, you have to set the last part of the class |
||
| 29 | * name as configuration value so the manager factory knows which class it |
||
| 30 | * has to instantiate. |
||
| 31 | * |
||
| 32 | * For example, if the name of the default class is |
||
| 33 | * |
||
| 34 | * \Aimeos\MShop\Order\Manager\Standard |
||
| 35 | * |
||
| 36 | * and you want to replace it with your own version named |
||
| 37 | * |
||
| 38 | * \Aimeos\MShop\Order\Manager\Mymanager |
||
| 39 | * |
||
| 40 | * then you have to set the this configuration option: |
||
| 41 | * |
||
| 42 | * mshop/order/manager/name = Mymanager |
||
| 43 | * |
||
| 44 | * The value is the last part of your own class name and it's case sensitive, |
||
| 45 | * so take care that the configuration value is exactly named like the last |
||
| 46 | * part of the class name. |
||
| 47 | * |
||
| 48 | * The allowed characters of the class name are A-Z, a-z and 0-9. No other |
||
| 49 | * characters are possible! You should always start the last part of the class |
||
| 50 | * name with an upper case character and continue only with lower case characters |
||
| 51 | * or numbers. Avoid chamel case names like "MyManager"! |
||
| 52 | * |
||
| 53 | * @param string Last part of the class name |
||
| 54 | * @since 2014.03 |
||
| 55 | * @category Developer |
||
| 56 | */ |
||
| 57 | |||
| 58 | /** mshop/order/manager/decorators/excludes |
||
| 59 | * Excludes decorators added by the "common" option from the order manager |
||
| 60 | * |
||
| 61 | * Decorators extend the functionality of a class by adding new aspects |
||
| 62 | * (e.g. log what is currently done), executing the methods of the underlying |
||
| 63 | * class only in certain conditions (e.g. only for logged in users) or |
||
| 64 | * modify what is returned to the caller. |
||
| 65 | * |
||
| 66 | * This option allows you to remove a decorator added via |
||
| 67 | * "mshop/common/manager/decorators/default" before they are wrapped |
||
| 68 | * around the order manager. |
||
| 69 | * |
||
| 70 | * mshop/order/manager/decorators/excludes = array( 'decorator1' ) |
||
| 71 | * |
||
| 72 | * This would remove the decorator named "decorator1" from the list of |
||
| 73 | * common decorators ("\Aimeos\MShop\Common\Manager\Decorator\*") added via |
||
| 74 | * "mshop/common/manager/decorators/default" for the order manager. |
||
| 75 | * |
||
| 76 | * @param array List of decorator names |
||
| 77 | * @since 2014.03 |
||
| 78 | * @category Developer |
||
| 79 | * @see mshop/common/manager/decorators/default |
||
| 80 | * @see mshop/order/manager/decorators/global |
||
| 81 | * @see mshop/order/manager/decorators/local |
||
| 82 | */ |
||
| 83 | |||
| 84 | /** mshop/order/manager/decorators/global |
||
| 85 | * Adds a list of globally available decorators only to the order manager |
||
| 86 | * |
||
| 87 | * Decorators extend the functionality of a class by adding new aspects |
||
| 88 | * (e.g. log what is currently done), executing the methods of the underlying |
||
| 89 | * class only in certain conditions (e.g. only for logged in users) or |
||
| 90 | * modify what is returned to the caller. |
||
| 91 | * |
||
| 92 | * This option allows you to wrap global decorators |
||
| 93 | * ("\Aimeos\MShop\Common\Manager\Decorator\*") around the order manager. |
||
| 94 | * |
||
| 95 | * mshop/order/manager/decorators/global = array( 'decorator1' ) |
||
| 96 | * |
||
| 97 | * This would add the decorator named "decorator1" defined by |
||
| 98 | * "\Aimeos\MShop\Common\Manager\Decorator\Decorator1" only to the order |
||
| 99 | * manager. |
||
| 100 | * |
||
| 101 | * @param array List of decorator names |
||
| 102 | * @since 2014.03 |
||
| 103 | * @category Developer |
||
| 104 | * @see mshop/common/manager/decorators/default |
||
| 105 | * @see mshop/order/manager/decorators/excludes |
||
| 106 | * @see mshop/order/manager/decorators/local |
||
| 107 | */ |
||
| 108 | |||
| 109 | /** mshop/order/manager/decorators/local |
||
| 110 | * Adds a list of local decorators only to the order manager |
||
| 111 | * |
||
| 112 | * Decorators extend the functionality of a class by adding new aspects |
||
| 113 | * (e.g. log what is currently done), executing the methods of the underlying |
||
| 114 | * class only in certain conditions (e.g. only for logged in users) or |
||
| 115 | * modify what is returned to the caller. |
||
| 116 | * |
||
| 117 | * This option allows you to wrap local decorators |
||
| 118 | * ("\Aimeos\MShop\Order\Manager\Decorator\*") around the order manager. |
||
| 119 | * |
||
| 120 | * mshop/order/manager/decorators/local = array( 'decorator2' ) |
||
| 121 | * |
||
| 122 | * This would add the decorator named "decorator2" defined by |
||
| 123 | * "\Aimeos\MShop\Order\Manager\Decorator\Decorator2" only to the order |
||
| 124 | * manager. |
||
| 125 | * |
||
| 126 | * @param array List of decorator names |
||
| 127 | * @since 2014.03 |
||
| 128 | * @category Developer |
||
| 129 | * @see mshop/common/manager/decorators/default |
||
| 130 | * @see mshop/order/manager/decorators/excludes |
||
| 131 | * @see mshop/order/manager/decorators/global |
||
| 132 | */ |
||
| 133 | |||
| 134 | |||
| 135 | private $searchConfig = array( |
||
| 136 | 'order.id' => array( |
||
| 137 | 'code' => 'order.id', |
||
| 138 | 'internalcode' => 'mord."id"', |
||
| 139 | 'label' => 'Invoice ID', |
||
| 140 | 'type' => 'integer', |
||
| 141 | 'internaltype' => \Aimeos\Base\DB\Statement\Base::PARAM_INT, |
||
| 142 | ), |
||
| 143 | 'order.siteid' => array( |
||
| 144 | 'code' => 'order.siteid', |
||
| 145 | 'internalcode' => 'mord."siteid"', |
||
| 146 | 'label' => 'Invoice site ID', |
||
| 147 | 'type' => 'string', |
||
| 148 | 'internaltype' => \Aimeos\Base\DB\Statement\Base::PARAM_STR, |
||
| 149 | 'public' => false, |
||
| 150 | ), |
||
| 151 | 'order.invoiceno' => array( |
||
| 152 | 'code' => 'order.invoiceno', |
||
| 153 | 'internalcode' => 'mord."invoiceno"', |
||
| 154 | 'label' => 'Invoice number', |
||
| 155 | 'type' => 'integer', |
||
| 156 | 'internaltype' => \Aimeos\Base\DB\Statement\Base::PARAM_STR, |
||
| 157 | ), |
||
| 158 | 'order.relatedid' => array( |
||
| 159 | 'code' => 'order.relatedid', |
||
| 160 | 'internalcode' => 'mord."relatedid"', |
||
| 161 | 'label' => 'Related invoice ID', |
||
| 162 | 'type' => 'string', |
||
| 163 | 'internaltype' => \Aimeos\Base\DB\Statement\Base::PARAM_STR, |
||
| 164 | ), |
||
| 165 | 'order.channel' => array( |
||
| 166 | 'code' => 'order.channel', |
||
| 167 | 'internalcode' => 'mord."channel"', |
||
| 168 | 'label' => 'Order channel', |
||
| 169 | 'type' => 'string', |
||
| 170 | 'internaltype' => \Aimeos\Base\DB\Statement\Base::PARAM_STR, |
||
| 171 | ), |
||
| 172 | 'order.datepayment' => array( |
||
| 173 | 'code' => 'order.datepayment', |
||
| 174 | 'internalcode' => 'mord."datepayment"', |
||
| 175 | 'label' => 'Purchase date', |
||
| 176 | 'type' => 'datetime', |
||
| 177 | 'internaltype' => \Aimeos\Base\DB\Statement\Base::PARAM_STR, |
||
| 178 | ), |
||
| 179 | 'order.datedelivery' => array( |
||
| 180 | 'code' => 'order.datedelivery', |
||
| 181 | 'internalcode' => 'mord."datedelivery"', |
||
| 182 | 'label' => 'Delivery date', |
||
| 183 | 'type' => 'datetime', |
||
| 184 | 'internaltype' => \Aimeos\Base\DB\Statement\Base::PARAM_STR, |
||
| 185 | ), |
||
| 186 | 'order.statusdelivery' => array( |
||
| 187 | 'code' => 'order.statusdelivery', |
||
| 188 | 'internalcode' => 'mord."statusdelivery"', |
||
| 189 | 'label' => 'Delivery status', |
||
| 190 | 'type' => 'integer', |
||
| 191 | 'internaltype' => \Aimeos\Base\DB\Statement\Base::PARAM_INT, |
||
| 192 | ), |
||
| 193 | 'order.statuspayment' => array( |
||
| 194 | 'code' => 'order.statuspayment', |
||
| 195 | 'internalcode' => 'mord."statuspayment"', |
||
| 196 | 'label' => 'Payment status', |
||
| 197 | 'type' => 'integer', |
||
| 198 | 'internaltype' => \Aimeos\Base\DB\Statement\Base::PARAM_INT, |
||
| 199 | ), |
||
| 200 | 'order.sitecode' => array( |
||
| 201 | 'code' => 'order.sitecode', |
||
| 202 | 'internalcode' => 'mord."sitecode"', |
||
| 203 | 'label' => 'Order site code', |
||
| 204 | 'type' => 'string', |
||
| 205 | 'internaltype' => \Aimeos\Base\DB\Statement\Base::PARAM_STR, |
||
| 206 | 'public' => false, |
||
| 207 | ), |
||
| 208 | 'order.customerid' => array( |
||
| 209 | 'code' => 'order.customerid', |
||
| 210 | 'internalcode' => 'mord."customerid"', |
||
| 211 | 'label' => 'Order customer ID', |
||
| 212 | 'type' => 'string', |
||
| 213 | 'internaltype' => \Aimeos\Base\DB\Statement\Base::PARAM_STR, |
||
| 214 | ), |
||
| 215 | 'order.customerref' => array( |
||
| 216 | 'code' => 'order.customerref', |
||
| 217 | 'internalcode' => 'mord."customerref"', |
||
| 218 | 'label' => 'Order customer reference', |
||
| 219 | 'type' => 'string', |
||
| 220 | 'internaltype' => \Aimeos\Base\DB\Statement\Base::PARAM_STR, |
||
| 221 | ), |
||
| 222 | 'order.languageid' => array( |
||
| 223 | 'code' => 'order.languageid', |
||
| 224 | 'internalcode' => 'mord."langid"', |
||
| 225 | 'label' => 'Order language code', |
||
| 226 | 'type' => 'string', |
||
| 227 | 'internaltype' => \Aimeos\Base\DB\Statement\Base::PARAM_STR, |
||
| 228 | ), |
||
| 229 | 'order.currencyid' => array( |
||
| 230 | 'code' => 'order.currencyid', |
||
| 231 | 'internalcode' => 'mord."currencyid"', |
||
| 232 | 'label' => 'Order currencyid code', |
||
| 233 | 'type' => 'string', |
||
| 234 | 'internaltype' => \Aimeos\Base\DB\Statement\Base::PARAM_STR, |
||
| 235 | ), |
||
| 236 | 'order.price' => array( |
||
| 237 | 'code' => 'order.price', |
||
| 238 | 'internalcode' => 'mord."price"', |
||
| 239 | 'label' => 'Order price amount', |
||
| 240 | 'type' => 'string', |
||
| 241 | 'internaltype' => \Aimeos\Base\DB\Statement\Base::PARAM_STR, |
||
| 242 | ), |
||
| 243 | 'order.costs' => array( |
||
| 244 | 'code' => 'order.costs', |
||
| 245 | 'internalcode' => 'mord."costs"', |
||
| 246 | 'label' => 'Order shipping amount', |
||
| 247 | 'type' => 'string', |
||
| 248 | 'internaltype' => \Aimeos\Base\DB\Statement\Base::PARAM_STR, |
||
| 249 | ), |
||
| 250 | 'order.rebate' => array( |
||
| 251 | 'code' => 'order.rebate', |
||
| 252 | 'internalcode' => 'mord."rebate"', |
||
| 253 | 'label' => 'Order rebate amount', |
||
| 254 | 'type' => 'string', |
||
| 255 | 'internaltype' => \Aimeos\Base\DB\Statement\Base::PARAM_STR, |
||
| 256 | ), |
||
| 257 | 'order.taxvalue' => array( |
||
| 258 | 'code' => 'order.taxvalue', |
||
| 259 | 'internalcode' => 'mord."tax"', |
||
| 260 | 'label' => 'Order tax amount', |
||
| 261 | 'type' => 'string', |
||
| 262 | 'internaltype' => \Aimeos\Base\DB\Statement\Base::PARAM_STR, |
||
| 263 | ), |
||
| 264 | 'order.taxflag' => array( |
||
| 265 | 'code' => 'order.taxflag', |
||
| 266 | 'internalcode' => 'mord."taxflag"', |
||
| 267 | 'label' => 'Order tax flag (0=net, 1=gross)', |
||
| 268 | 'type' => 'string', |
||
| 269 | 'internaltype' => \Aimeos\Base\DB\Statement\Base::PARAM_INT, |
||
| 270 | ), |
||
| 271 | 'order.comment' => array( |
||
| 272 | 'code' => 'order.comment', |
||
| 273 | 'internalcode' => 'mord."comment"', |
||
| 274 | 'label' => 'Order comment', |
||
| 275 | 'type' => 'string', |
||
| 276 | 'internaltype' => \Aimeos\Base\DB\Statement\Base::PARAM_STR, |
||
| 277 | ), |
||
| 278 | 'order.cdate' => array( |
||
| 279 | 'code' => 'order.cdate', |
||
| 280 | 'internalcode' => 'mord."cdate"', |
||
| 281 | 'label' => 'Create date', |
||
| 282 | 'type' => 'string', |
||
| 283 | 'internaltype' => \Aimeos\Base\DB\Statement\Base::PARAM_STR, |
||
| 284 | 'public' => false, |
||
| 285 | ), |
||
| 286 | 'order.cmonth' => array( |
||
| 287 | 'code' => 'order.cmonth', |
||
| 288 | 'internalcode' => 'mord."cmonth"', |
||
| 289 | 'label' => 'Create month', |
||
| 290 | 'type' => 'string', |
||
| 291 | 'internaltype' => \Aimeos\Base\DB\Statement\Base::PARAM_STR, |
||
| 292 | 'public' => false, |
||
| 293 | ), |
||
| 294 | 'order.cweek' => array( |
||
| 295 | 'code' => 'order.cweek', |
||
| 296 | 'internalcode' => 'mord."cweek"', |
||
| 297 | 'label' => 'Create week', |
||
| 298 | 'type' => 'string', |
||
| 299 | 'internaltype' => \Aimeos\Base\DB\Statement\Base::PARAM_STR, |
||
| 300 | 'public' => false, |
||
| 301 | ), |
||
| 302 | 'order.cwday' => array( |
||
| 303 | 'code' => 'order.cwday', |
||
| 304 | 'internalcode' => 'mord."cwday"', |
||
| 305 | 'label' => 'Create weekday', |
||
| 306 | 'type' => 'string', |
||
| 307 | 'internaltype' => \Aimeos\Base\DB\Statement\Base::PARAM_STR, |
||
| 308 | 'public' => false, |
||
| 309 | ), |
||
| 310 | 'order.chour' => array( |
||
| 311 | 'code' => 'order.chour', |
||
| 312 | 'internalcode' => 'mord."chour"', |
||
| 313 | 'label' => 'Create hour', |
||
| 314 | 'type' => 'string', |
||
| 315 | 'internaltype' => \Aimeos\Base\DB\Statement\Base::PARAM_STR, |
||
| 316 | 'public' => false, |
||
| 317 | ), |
||
| 318 | 'order.ctime' => array( |
||
| 319 | 'code' => 'order.ctime', |
||
| 320 | 'internalcode' => 'mord."ctime"', |
||
| 321 | 'label' => 'Create date/time', |
||
| 322 | 'type' => 'datetime', |
||
| 323 | 'internaltype' => \Aimeos\Base\DB\Statement\Base::PARAM_STR, |
||
| 324 | 'public' => false, |
||
| 325 | ), |
||
| 326 | 'order.mtime' => array( |
||
| 327 | 'code' => 'order.mtime', |
||
| 328 | 'internalcode' => 'mord."mtime"', |
||
| 329 | 'label' => 'Modify date/time', |
||
| 330 | 'type' => 'datetime', |
||
| 331 | 'internaltype' => \Aimeos\Base\DB\Statement\Base::PARAM_STR, |
||
| 332 | 'public' => false, |
||
| 333 | ), |
||
| 334 | 'order.editor' => array( |
||
| 335 | 'code' => 'order.editor', |
||
| 336 | 'internalcode' => 'mord."editor"', |
||
| 337 | 'label' => 'Editor', |
||
| 338 | 'type' => 'string', |
||
| 339 | 'internaltype' => \Aimeos\Base\DB\Statement\Base::PARAM_STR, |
||
| 340 | 'public' => false, |
||
| 341 | ), |
||
| 342 | 'order:status' => array( |
||
| 343 | 'code' => 'order:status()', |
||
| 344 | 'internalcode' => '( SELECT COUNT(mordst_cs."parentid") |
||
| 345 | FROM "mshop_order_status" AS mordst_cs |
||
| 346 | WHERE mord."id" = mordst_cs."parentid" AND :site |
||
| 347 | AND mordst_cs."type" = $1 AND mordst_cs."value" IN ( $2 ) )', |
||
| 348 | 'label' => 'Number of order status items, parameter(<type>,<value>)', |
||
| 349 | 'type' => 'integer', |
||
| 350 | 'internaltype' => \Aimeos\Base\DB\Statement\Base::PARAM_INT, |
||
| 351 | 'public' => false, |
||
| 352 | ), |
||
| 353 | ); |
||
| 354 | |||
| 355 | |||
| 356 | /** |
||
| 357 | * Creates the manager that will use the given context object. |
||
| 358 | * |
||
| 359 | * @param \Aimeos\MShop\ContextIface $context Context object with required objects |
||
| 360 | */ |
||
| 361 | public function __construct( \Aimeos\MShop\ContextIface $context ) |
||
| 362 | { |
||
| 363 | parent::__construct( $context ); |
||
| 364 | $this->setResourceName( 'db-order' ); |
||
| 365 | |||
| 366 | $level = \Aimeos\MShop\Locale\Manager\Base::SITE_ALL; |
||
| 367 | $level = $context->config()->get( 'mshop/order/manager/sitemode', $level ); |
||
| 368 | |||
| 369 | $name = 'order:status'; |
||
| 370 | $expr = $this->siteString( 'mordst_cs."siteid"', $level ); |
||
| 371 | $this->searchConfig[$name]['internalcode'] = str_replace( ':site', $expr, $this->searchConfig[$name]['internalcode'] ); |
||
| 372 | } |
||
| 373 | |||
| 374 | |||
| 375 | /** |
||
| 376 | * Counts the number items that are available for the values of the given key. |
||
| 377 | * |
||
| 378 | * @param \Aimeos\Base\Criteria\Iface $search Search criteria |
||
| 379 | * @param array|string $key Search key or list of key to aggregate items for |
||
| 380 | * @param string|null $value Search key for aggregating the value column |
||
| 381 | * @param string|null $type Type of the aggregation, empty string for count or "sum" or "avg" (average) |
||
| 382 | * @return \Aimeos\Map List of the search keys as key and the number of counted items as value |
||
| 383 | */ |
||
| 384 | public function aggregate( \Aimeos\Base\Criteria\Iface $search, $key, string $value = null, string $type = null ) : \Aimeos\Map |
||
| 385 | { |
||
| 386 | /** mshop/order/manager/aggregate/mysql |
||
| 387 | * Counts the number of records grouped by the values in the key column and matched by the given criteria |
||
| 388 | * |
||
| 389 | * @see mshop/order/manager/aggregate/ansi |
||
| 390 | */ |
||
| 391 | |||
| 392 | /** mshop/order/manager/aggregate/ansi |
||
| 393 | * Counts the number of records grouped by the values in the key column and matched by the given criteria |
||
| 394 | * |
||
| 395 | * Groups all records by the values in the key column and counts their |
||
| 396 | * occurence. The matched records can be limited by the given criteria |
||
| 397 | * from the order database. The records must be from one of the sites |
||
| 398 | * that are configured via the context item. If the current site is part |
||
| 399 | * of a tree of sites, the statement can count all records from the |
||
| 400 | * current site and the complete sub-tree of sites. |
||
| 401 | * |
||
| 402 | * As the records can normally be limited by criteria from sub-managers, |
||
| 403 | * their tables must be joined in the SQL context. This is done by |
||
| 404 | * using the "internaldeps" property from the definition of the ID |
||
| 405 | * column of the sub-managers. These internal dependencies specify |
||
| 406 | * the JOIN between the tables and the used columns for joining. The |
||
| 407 | * ":joins" placeholder is then replaced by the JOIN strings from |
||
| 408 | * the sub-managers. |
||
| 409 | * |
||
| 410 | * To limit the records matched, conditions can be added to the given |
||
| 411 | * criteria object. It can contain comparisons like column names that |
||
| 412 | * must match specific values which can be combined by AND, OR or NOT |
||
| 413 | * operators. The resulting string of SQL conditions replaces the |
||
| 414 | * ":cond" placeholder before the statement is sent to the database |
||
| 415 | * server. |
||
| 416 | * |
||
| 417 | * This statement doesn't return any records. Instead, it returns pairs |
||
| 418 | * of the different values found in the key column together with the |
||
| 419 | * number of records that have been found for that key values. |
||
| 420 | * |
||
| 421 | * The SQL statement should conform to the ANSI standard to be |
||
| 422 | * compatible with most relational database systems. This also |
||
| 423 | * includes using double quotes for table and column names. |
||
| 424 | * |
||
| 425 | * @param string SQL statement for aggregating order items |
||
| 426 | * @since 2014.09 |
||
| 427 | * @category Developer |
||
| 428 | * @see mshop/order/manager/insert/ansi |
||
| 429 | * @see mshop/order/manager/update/ansi |
||
| 430 | * @see mshop/order/manager/newid/ansi |
||
| 431 | * @see mshop/order/manager/delete/ansi |
||
| 432 | * @see mshop/order/manager/search/ansi |
||
| 433 | * @see mshop/order/manager/count/ansi |
||
| 434 | */ |
||
| 435 | |||
| 436 | /** mshop/order/manager/aggregateavg/mysql |
||
| 437 | * Computes the average of all values grouped by the key column and matched by the given criteria |
||
| 438 | * |
||
| 439 | * @param string SQL statement for aggregating the order items and computing the average value |
||
| 440 | * @since 2017.10 |
||
| 441 | * @category Developer |
||
| 442 | * @see mshop/order/manager/aggregateavg/ansi |
||
| 443 | * @see mshop/order/manager/aggregate/mysql |
||
| 444 | */ |
||
| 445 | |||
| 446 | /** mshop/order/manager/aggregateavg/ansi |
||
| 447 | * Computes the average of all values grouped by the key column and matched by the given criteria |
||
| 448 | * |
||
| 449 | * @param string SQL statement for aggregating the order items and computing the average value |
||
| 450 | * @since 2017.10 |
||
| 451 | * @category Developer |
||
| 452 | * @see mshop/order/manager/aggregate/ansi |
||
| 453 | */ |
||
| 454 | |||
| 455 | /** mshop/order/manager/aggregatesum/mysql |
||
| 456 | * Computes the sum of all values grouped by the key column and matched by the given criteria |
||
| 457 | * |
||
| 458 | * @param string SQL statement for aggregating the order items and computing the sum |
||
| 459 | * @since 2017.10 |
||
| 460 | * @category Developer |
||
| 461 | * @see mshop/order/manager/aggregatesum/ansi |
||
| 462 | * @see mshop/order/manager/aggregate/mysql |
||
| 463 | */ |
||
| 464 | |||
| 465 | /** mshop/order/manager/aggregatesum/ansi |
||
| 466 | * Computes the sum of all values grouped by the key column and matched by the given criteria |
||
| 467 | * |
||
| 468 | * @param string SQL statement for aggregating the order items and computing the sum |
||
| 469 | * @since 2017.10 |
||
| 470 | * @category Developer |
||
| 471 | * @see mshop/order/manager/aggregate/ansi |
||
| 472 | */ |
||
| 473 | |||
| 474 | $cfgkey = 'mshop/order/manager/aggregate'; |
||
| 475 | return $this->aggregateBase( $search, $key, $cfgkey, ['order'], $value, $type ); |
||
| 476 | } |
||
| 477 | |||
| 478 | |||
| 479 | /** |
||
| 480 | * Removes old entries from the storage. |
||
| 481 | * |
||
| 482 | * @param iterable $siteids List of IDs for sites whose entries should be deleted |
||
| 483 | * @return \Aimeos\MShop\Order\Manager\Iface Manager object for chaining method calls |
||
| 484 | */ |
||
| 485 | public function clear( iterable $siteids ) : \Aimeos\MShop\Common\Manager\Iface |
||
| 486 | { |
||
| 487 | $path = 'mshop/order/manager/submanagers'; |
||
| 488 | $default = ['address', 'coupon', 'product', 'service', 'status']; |
||
| 489 | |||
| 490 | foreach( $this->context()->config()->get( $path, $default ) as $domain ) { |
||
| 491 | $this->object()->getSubManager( $domain )->clear( $siteids ); |
||
| 492 | } |
||
| 493 | |||
| 494 | return $this->clearBase( $siteids, 'mshop/order/manager/delete' ); |
||
| 495 | } |
||
| 496 | |||
| 497 | |||
| 498 | /** |
||
| 499 | * Creates a new empty item instance |
||
| 500 | * |
||
| 501 | * @param array $values Values the item should be initialized with |
||
| 502 | * @return \Aimeos\MShop\Order\Item\Iface New order item object |
||
| 503 | */ |
||
| 504 | public function create( array $values = [] ) : \Aimeos\MShop\Common\Item\Iface |
||
| 516 | } |
||
| 517 | |||
| 518 | |||
| 519 | /** |
||
| 520 | * Removes multiple items. |
||
| 521 | * |
||
| 522 | * @param \Aimeos\MShop\Common\Item\Iface[]|string[] $itemIds List of item objects or IDs of the items |
||
| 523 | * @return \Aimeos\MShop\Order\Manager\Iface Manager object for chaining method calls |
||
| 524 | */ |
||
| 525 | public function delete( $itemIds ) : \Aimeos\MShop\Common\Manager\Iface |
||
| 526 | { |
||
| 527 | /** mshop/order/manager/delete/mysql |
||
| 528 | * Deletes the items matched by the given IDs from the database |
||
| 529 | * |
||
| 530 | * @see mshop/order/manager/delete/ansi |
||
| 531 | */ |
||
| 532 | |||
| 533 | /** mshop/order/manager/delete/ansi |
||
| 534 | * Deletes the items matched by the given IDs from the database |
||
| 535 | * |
||
| 536 | * Removes the records specified by the given IDs from the order database. |
||
| 537 | * The records must be from the site that is configured via the |
||
| 538 | * context item. |
||
| 539 | * |
||
| 540 | * The ":cond" placeholder is replaced by the name of the ID column and |
||
| 541 | * the given ID or list of IDs while the site ID is bound to the question |
||
| 542 | * mark. |
||
| 543 | * |
||
| 544 | * The SQL statement should conform to the ANSI standard to be |
||
| 545 | * compatible with most relational database systems. This also |
||
| 546 | * includes using double quotes for table and column names. |
||
| 547 | * |
||
| 548 | * @param string SQL statement for deleting items |
||
| 549 | * @since 2014.03 |
||
| 550 | * @category Developer |
||
| 551 | * @see mshop/order/manager/insert/ansi |
||
| 552 | * @see mshop/order/manager/update/ansi |
||
| 553 | * @see mshop/order/manager/newid/ansi |
||
| 554 | * @see mshop/order/manager/search/ansi |
||
| 555 | * @see mshop/order/manager/count/ansi |
||
| 556 | */ |
||
| 557 | $path = 'mshop/order/manager/delete'; |
||
| 558 | |||
| 559 | return $this->deleteItemsBase( $itemIds, $path ); |
||
| 560 | } |
||
| 561 | |||
| 562 | |||
| 563 | /** |
||
| 564 | * Creates a search critera object |
||
| 565 | * |
||
| 566 | * @param bool|null $default Add default criteria or NULL for relaxed default criteria |
||
| 567 | * @param bool $site TRUE to add site criteria to show orders with available products only |
||
| 568 | * @return \Aimeos\Base\Criteria\Iface New search criteria object |
||
| 569 | */ |
||
| 570 | public function filter( ?bool $default = false, bool $site = false ) : \Aimeos\Base\Criteria\Iface |
||
| 571 | { |
||
| 572 | $search = parent::filter( $default ); |
||
| 573 | $context = $this->context(); |
||
| 574 | |||
| 575 | if( $default !== false ) { |
||
| 576 | $search->add( ['order.customerid' => $context->user()] ); |
||
| 577 | } |
||
| 578 | |||
| 579 | if( $site === true ) |
||
| 580 | { |
||
| 581 | $level = \Aimeos\MShop\Locale\Manager\Base::SITE_SUBTREE; |
||
| 582 | $search->add( $this->siteCondition( 'order.product.siteid', $level ) ); |
||
| 583 | } |
||
| 584 | |||
| 585 | return $search; |
||
| 586 | } |
||
| 587 | |||
| 588 | |||
| 589 | /** |
||
| 590 | * Returns an order invoice item built from database values. |
||
| 591 | * |
||
| 592 | * @param string $id Unique id of the order invoice |
||
| 593 | * @param string[] $ref List of domains to fetch list items and referenced items for |
||
| 594 | * @param bool|null $default Add default criteria or NULL for relaxed default criteria |
||
| 595 | * @return \Aimeos\MShop\Order\Item\Iface Returns order invoice item of the given id |
||
| 596 | * @throws \Aimeos\MShop\Order\Exception If item couldn't be found |
||
| 597 | */ |
||
| 598 | public function get( string $id, array $ref = [], ?bool $default = false ) : \Aimeos\MShop\Common\Item\Iface |
||
| 599 | { |
||
| 600 | return $this->getItemBase( 'order.id', $id, $ref, $default ); |
||
| 601 | } |
||
| 602 | |||
| 603 | |||
| 604 | /** |
||
| 605 | * Returns the available manager types |
||
| 606 | * |
||
| 607 | * @param bool $withsub Return also the resource type of sub-managers if true |
||
| 608 | * @return string[] Type of the manager and submanagers, subtypes are separated by slashes |
||
| 609 | */ |
||
| 610 | public function getResourceType( bool $withsub = true ) : array |
||
| 616 | } |
||
| 617 | |||
| 618 | |||
| 619 | /** |
||
| 620 | * Returns the attributes that can be used for searching. |
||
| 621 | * |
||
| 622 | * @param bool $withsub Return also attributes of sub-managers if true |
||
| 623 | * @return \Aimeos\Base\Criteria\Attribute\Iface[] List of search attribute items |
||
| 624 | */ |
||
| 625 | public function getSearchAttributes( bool $withsub = true ) : array |
||
| 648 | } |
||
| 649 | |||
| 650 | |||
| 651 | /** |
||
| 652 | * Creates a one-time order in the storage from the given invoice object. |
||
| 653 | * |
||
| 654 | * @param \Aimeos\MShop\Order\Item\Iface $item Order item with necessary values |
||
| 655 | * @param bool $fetch True if the new ID should be returned in the item |
||
| 656 | * @return \Aimeos\MShop\Order\Item\Iface $item Updated item including the generated ID |
||
| 657 | */ |
||
| 658 | protected function saveItem( \Aimeos\MShop\Order\Item\Iface $item, bool $fetch = true ) : \Aimeos\MShop\Order\Item\Iface |
||
| 849 | } |
||
| 850 | |||
| 851 | |||
| 852 | /** |
||
| 853 | * Searches for orders based on the given criteria. |
||
| 854 | * |
||
| 855 | * @param \Aimeos\Base\Criteria\Iface $search Search criteria object |
||
| 856 | * @param string[] $ref List of domains to fetch list items and referenced items for |
||
| 857 | * @param int|null &$total Number of items that are available in total |
||
| 858 | * @return \Aimeos\Map List of items implementing \Aimeos\MShop\Order\Item\Iface with ids as keys |
||
| 859 | */ |
||
| 860 | public function search( \Aimeos\Base\Criteria\Iface $search, array $ref = [], int &$total = null ) : \Aimeos\Map |
||
| 861 | { |
||
| 862 | $context = $this->context(); |
||
| 863 | $conn = $context->db( $this->getResourceName() ); |
||
| 864 | |||
| 865 | $priceManager = \Aimeos\MShop::create( $context, 'price' ); |
||
| 866 | $localeManager = \Aimeos\MShop::create( $context, 'locale' ); |
||
| 867 | |||
| 868 | $map = $items = $custItems = []; |
||
| 869 | $required = ['order']; |
||
| 870 | |||
| 871 | /** mshop/order/manager/sitemode |
||
| 872 | * Mode how items from levels below or above in the site tree are handled |
||
| 873 | * |
||
| 874 | * By default, only items from the current site are fetched from the |
||
| 875 | * storage. If the ai-sites extension is installed, you can create a |
||
| 876 | * tree of sites. Then, this setting allows you to define for the |
||
| 877 | * whole order domain if items from parent sites are inherited, |
||
| 878 | * sites from child sites are aggregated or both. |
||
| 879 | * |
||
| 880 | * Available constants for the site mode are: |
||
| 881 | * * 0 = only items from the current site |
||
| 882 | * * 1 = inherit items from parent sites |
||
| 883 | * * 2 = aggregate items from child sites |
||
| 884 | * * 3 = inherit and aggregate items at the same time |
||
| 885 | * |
||
| 886 | * You also need to set the mode in the locale manager |
||
| 887 | * (mshop/locale/manager/sitelevel) to one of the constants. |
||
| 888 | * If you set it to the same value, it will work as described but you |
||
| 889 | * can also use different modes. For example, if inheritance and |
||
| 890 | * aggregation is configured the locale manager but only inheritance |
||
| 891 | * in the domain manager because aggregating items makes no sense in |
||
| 892 | * this domain, then items wil be only inherited. Thus, you have full |
||
| 893 | * control over inheritance and aggregation in each domain. |
||
| 894 | * |
||
| 895 | * @param int Constant from Aimeos\MShop\Locale\Manager\Base class |
||
| 896 | * @category Developer |
||
| 897 | * @since 2018.01 |
||
| 898 | * @see mshop/locale/manager/sitelevel |
||
| 899 | */ |
||
| 900 | $level = \Aimeos\MShop\Locale\Manager\Base::SITE_ALL; |
||
| 901 | $level = $context->config()->get( 'mshop/order/manager/sitemode', $level ); |
||
| 902 | |||
| 903 | /** mshop/order/manager/search/mysql |
||
| 904 | * Retrieves the records matched by the given criteria in the database |
||
| 905 | * |
||
| 906 | * @see mshop/order/manager/search/ansi |
||
| 907 | */ |
||
| 908 | |||
| 909 | /** mshop/order/manager/search/ansi |
||
| 910 | * Retrieves the records matched by the given criteria in the database |
||
| 911 | * |
||
| 912 | * Fetches the records matched by the given criteria from the order |
||
| 913 | * database. The records must be from one of the sites that are |
||
| 914 | * configured via the context item. If the current site is part of |
||
| 915 | * a tree of sites, the SELECT statement can retrieve all records |
||
| 916 | * from the current site and the complete sub-tree of sites. |
||
| 917 | * |
||
| 918 | * As the records can normally be limited by criteria from sub-managers, |
||
| 919 | * their tables must be joined in the SQL context. This is done by |
||
| 920 | * using the "internaldeps" property from the definition of the ID |
||
| 921 | * column of the sub-managers. These internal dependencies specify |
||
| 922 | * the JOIN between the tables and the used columns for joining. The |
||
| 923 | * ":joins" placeholder is then replaced by the JOIN strings from |
||
| 924 | * the sub-managers. |
||
| 925 | * |
||
| 926 | * To limit the records matched, conditions can be added to the given |
||
| 927 | * criteria object. It can contain comparisons like column names that |
||
| 928 | * must match specific values which can be combined by AND, OR or NOT |
||
| 929 | * operators. The resulting string of SQL conditions replaces the |
||
| 930 | * ":cond" placeholder before the statement is sent to the database |
||
| 931 | * server. |
||
| 932 | * |
||
| 933 | * If the records that are retrieved should be ordered by one or more |
||
| 934 | * columns, the generated string of column / sort direction pairs |
||
| 935 | * replaces the ":order" placeholder. In case no ordering is required, |
||
| 936 | * the complete ORDER BY part including the "\/*-orderby*\/...\/*orderby-*\/" |
||
| 937 | * markers is removed to speed up retrieving the records. Columns of |
||
| 938 | * sub-managers can also be used for ordering the result set but then |
||
| 939 | * no index can be used. |
||
| 940 | * |
||
| 941 | * The number of returned records can be limited and can start at any |
||
| 942 | * number between the begining and the end of the result set. For that |
||
| 943 | * the ":size" and ":start" placeholders are replaced by the |
||
| 944 | * corresponding values from the criteria object. The default values |
||
| 945 | * are 0 for the start and 100 for the size value. |
||
| 946 | * |
||
| 947 | * The SQL statement should conform to the ANSI standard to be |
||
| 948 | * compatible with most relational database systems. This also |
||
| 949 | * includes using double quotes for table and column names. |
||
| 950 | * |
||
| 951 | * @param string SQL statement for searching items |
||
| 952 | * @since 2014.03 |
||
| 953 | * @category Developer |
||
| 954 | * @see mshop/order/manager/insert/ansi |
||
| 955 | * @see mshop/order/manager/update/ansi |
||
| 956 | * @see mshop/order/manager/newid/ansi |
||
| 957 | * @see mshop/order/manager/delete/ansi |
||
| 958 | * @see mshop/order/manager/count/ansi |
||
| 959 | */ |
||
| 960 | $cfgPathSearch = 'mshop/order/manager/search'; |
||
| 961 | |||
| 962 | /** mshop/order/manager/count/mysql |
||
| 963 | * Counts the number of records matched by the given criteria in the database |
||
| 964 | * |
||
| 965 | * @see mshop/order/manager/count/ansi |
||
| 966 | */ |
||
| 967 | |||
| 968 | /** mshop/order/manager/count/ansi |
||
| 969 | * Counts the number of records matched by the given criteria in the database |
||
| 970 | * |
||
| 971 | * Counts all records matched by the given criteria from the order |
||
| 972 | * database. The records must be from one of the sites that are |
||
| 973 | * configured via the context item. If the current site is part of |
||
| 974 | * a tree of sites, the statement can count all records from the |
||
| 975 | * current site and the complete sub-tree of sites. |
||
| 976 | * |
||
| 977 | * As the records can normally be limited by criteria from sub-managers, |
||
| 978 | * their tables must be joined in the SQL context. This is done by |
||
| 979 | * using the "internaldeps" property from the definition of the ID |
||
| 980 | * column of the sub-managers. These internal dependencies specify |
||
| 981 | * the JOIN between the tables and the used columns for joining. The |
||
| 982 | * ":joins" placeholder is then replaced by the JOIN strings from |
||
| 983 | * the sub-managers. |
||
| 984 | * |
||
| 985 | * To limit the records matched, conditions can be added to the given |
||
| 986 | * criteria object. It can contain comparisons like column names that |
||
| 987 | * must match specific values which can be combined by AND, OR or NOT |
||
| 988 | * operators. The resulting string of SQL conditions replaces the |
||
| 989 | * ":cond" placeholder before the statement is sent to the database |
||
| 990 | * server. |
||
| 991 | * |
||
| 992 | * Both, the strings for ":joins" and for ":cond" are the same as for |
||
| 993 | * the "search" SQL statement. |
||
| 994 | * |
||
| 995 | * Contrary to the "search" statement, it doesn't return any records |
||
| 996 | * but instead the number of records that have been found. As counting |
||
| 997 | * thousands of records can be a long running task, the maximum number |
||
| 998 | * of counted records is limited for performance reasons. |
||
| 999 | * |
||
| 1000 | * The SQL statement should conform to the ANSI standard to be |
||
| 1001 | * compatible with most relational database systems. This also |
||
| 1002 | * includes using double quotes for table and column names. |
||
| 1003 | * |
||
| 1004 | * @param string SQL statement for counting items |
||
| 1005 | * @since 2014.03 |
||
| 1006 | * @category Developer |
||
| 1007 | * @see mshop/order/manager/insert/ansi |
||
| 1008 | * @see mshop/order/manager/update/ansi |
||
| 1009 | * @see mshop/order/manager/newid/ansi |
||
| 1010 | * @see mshop/order/manager/delete/ansi |
||
| 1011 | * @see mshop/order/manager/search/ansi |
||
| 1012 | */ |
||
| 1013 | $cfgPathCount = 'mshop/order/manager/count'; |
||
| 1014 | |||
| 1015 | $results = $this->searchItemsBase( $conn, $search, $cfgPathSearch, $cfgPathCount, |
||
| 1016 | $required, $total, $level ); |
||
| 1017 | |||
| 1018 | try |
||
| 1019 | { |
||
| 1020 | while( ( $row = $results->fetch() ) !== null ) { |
||
| 1021 | $map[$row['order.id']] = $row; |
||
| 1022 | } |
||
| 1023 | } |
||
| 1024 | catch( \Exception $e ) |
||
| 1025 | { |
||
| 1026 | $results->finish(); |
||
| 1027 | throw $e; |
||
| 1028 | } |
||
| 1029 | |||
| 1030 | |||
| 1031 | if( ( isset( $ref['customer'] ) || in_array( 'customer', $ref ) ) |
||
| 1032 | && !( $ids = map( $map )->col( 'order.customerid' )->filter() )->empty() |
||
| 1033 | ) { |
||
| 1034 | $manager = \Aimeos\MShop::create( $context, 'customer' ); |
||
| 1035 | $search = $manager->filter()->slice( 0, count( $ids ) )->add( ['customer.id' => $ids] ); |
||
| 1036 | $custItems = $manager->search( $search, $ref )->all(); |
||
| 1037 | } |
||
| 1038 | |||
| 1039 | foreach( $map as $id => $row ) |
||
| 1040 | { |
||
| 1041 | // don't use fromArray() or set*() methods to avoid recalculation of tax value |
||
| 1042 | $price = $priceManager->create( [ |
||
| 1043 | 'price.currencyid' => $row['order.currencyid'], |
||
| 1044 | 'price.value' => $row['order.price'], |
||
| 1045 | 'price.costs' => $row['order.costs'], |
||
| 1046 | 'price.rebate' => $row['order.rebate'], |
||
| 1047 | 'price.taxflag' => $row['order.taxflag'], |
||
| 1048 | 'price.taxvalue' => $row['order.taxvalue'], |
||
| 1049 | ] ); |
||
| 1050 | |||
| 1051 | // you may need the site object! take care! |
||
| 1052 | $localeItem = $localeManager->create( [ |
||
| 1053 | 'locale.currencyid' => $row['order.currencyid'], |
||
| 1054 | 'locale.languageid' => $row['order.languageid'], |
||
| 1055 | 'locale.siteid' => $row['order.siteid'], |
||
| 1056 | ] ); |
||
| 1057 | |||
| 1058 | $map[$id] = [$price, $localeItem, $row, $custItems[$row['order.customerid'] ?? null] ?? null]; |
||
| 1059 | } |
||
| 1060 | |||
| 1061 | return $this->buildItems( $map, $ref ); |
||
| 1062 | } |
||
| 1063 | |||
| 1064 | |||
| 1065 | /** |
||
| 1066 | * Returns a new manager for order extensions |
||
| 1067 | * |
||
| 1068 | * @param string $manager Name of the sub manager type in lower case |
||
| 1069 | * @param string|null $name Name of the implementation, will be from configuration (or Default) if null |
||
| 1070 | * @return \Aimeos\MShop\Common\Manager\Iface Manager for different extensions, e.g base, etc. |
||
| 1071 | */ |
||
| 1072 | public function getSubManager( string $manager, string $name = null ) : \Aimeos\MShop\Common\Manager\Iface |
||
| 1075 | } |
||
| 1076 | |||
| 1077 | |||
| 1078 | /** |
||
| 1079 | * Adds the new payment and delivery values to the order status log. |
||
| 1080 | * |
||
| 1081 | * @param \Aimeos\MShop\Order\Item\Iface $item Order item object |
||
| 1082 | */ |
||
| 1083 | protected function addStatus( \Aimeos\MShop\Order\Item\Iface $item ) |
||
| 1104 | } |
||
| 1105 | } |
||
| 1106 | |||
| 1107 | |||
| 1108 | /** |
||
| 1109 | * Creates the order base item objects from the map and adds the referenced items |
||
| 1110 | * |
||
| 1111 | * @param array $map Associative list of order base IDs as keys and list of price/locale/row as values |
||
| 1112 | * @param string[] $ref Domain items that should be added as well, e.g. |
||
| 1113 | * "order/address", "order/coupon", "order/product", "order/service" |
||
| 1114 | * @return \Aimeos\Map List of items implementing \Aimeos\MShop\Order\Item\Iface with IDs as keys |
||
| 1115 | */ |
||
| 1116 | protected function buildItems( array $map, array $ref ) : \Aimeos\Map |
||
| 1155 | } |
||
| 1156 | |||
| 1157 | |||
| 1158 | /** |
||
| 1159 | * Creates a new invoice number for the passed order and site. |
||
| 1160 | * |
||
| 1161 | * @param \Aimeos\MShop\Order\Item\Iface $item Order item with necessary values |
||
| 1162 | * @return string Unique invoice number for the current site |
||
| 1163 | */ |
||
| 1164 | public function createInvoiceNumber( \Aimeos\MShop\Order\Item\Iface $item ) : string |
||
| 1191 | } |
||
| 1192 | |||
| 1193 | |||
| 1194 | /** |
||
| 1195 | * Returns a new and empty order base item (shopping basket). |
||
| 1196 | * |
||
| 1197 | * @param \Aimeos\MShop\Price\Item\Iface $price Default price of the basket (usually 0.00) |
||
| 1198 | * @param \Aimeos\MShop\Locale\Item\Iface $locale Locale item containing the site, language and currency |
||
| 1199 | * @param array $values Associative list of key/value pairs containing, e.g. the order or user ID |
||
| 1200 | * @param \Aimeos\MShop\Order\Item\Product\Iface[] $products List of ordered product items |
||
| 1201 | * @param \Aimeos\MShop\Order\Item\Address\Iface[] $addresses List of order address items |
||
| 1202 | * @param \Aimeos\MShop\Order\Item\Service\Iface[] $services List of order serviceitems |
||
| 1203 | * @param \Aimeos\MShop\Order\Item\Product\Iface[] $coupons Associative list of coupon codes as keys and items as values |
||
| 1204 | * @param \Aimeos\MShop\Customer\Item\Iface|null $custItem Customer item object if requested |
||
| 1205 | * @return \Aimeos\MShop\Order\Item\Iface Order base object |
||
| 1206 | */ |
||
| 1207 | protected function createItemBase( \Aimeos\MShop\Price\Item\Iface $price, \Aimeos\MShop\Locale\Item\Iface $locale, |
||
| 1213 | } |
||
| 1214 | |||
| 1215 | |||
| 1216 | /** |
||
| 1217 | * Creates a new basket containing the items from the order excluding the coupons. |
||
| 1218 | * If the last parameter is ture, the items will be marked as new and |
||
| 1219 | * modified so an additional order is stored when the basket is saved. |
||
| 1220 | * |
||
| 1221 | * @param string $id Base ID of the order to load |
||
| 1222 | * @param array $ref Basket parts that should be loaded too |
||
| 1223 | * @param bool $fresh Create a new basket by copying the existing one and remove IDs |
||
| 1224 | * @param bool $default True to use default criteria, false for no limitation |
||
| 1225 | * @return \Aimeos\MShop\Order\Item\Iface Basket including all items |
||
| 1226 | */ |
||
| 1227 | public function load( string $id, array $ref = ['order/address', 'order/coupon', 'order/product', 'order/service'], |
||
| 1283 | } |
||
| 1284 | |||
| 1285 | |||
| 1286 | /** |
||
| 1287 | * Saves the modified basket content |
||
| 1288 | * |
||
| 1289 | * @param \Aimeos\MShop\Order\Item\Iface $basket Basket content |
||
| 1290 | * @return \Aimeos\MShop\Order\Item\Iface Saved basket content |
||
| 1291 | */ |
||
| 1292 | protected function saveBasket( \Aimeos\MShop\Order\Item\Iface $basket ) : \Aimeos\MShop\Order\Item\Iface |
||
| 1302 |