Skip to content

Commit 5e27b0d

Browse files
committed
commerce@d9353f0
Fixed race condition in deleting old adjustments See craftcms/commerce#3901 Tested by customer here: https://app.frontapp.com/open/cnv_geujeix?key=nV4JNZkyEDPmMZxQ-f4Pwpev3ko5rULf
1 parent 69a8dcf commit 5e27b0d

File tree

4 files changed

+491
-70
lines changed

4 files changed

+491
-70
lines changed

docs/.artifacts/commerce/4.x/donations.md

Lines changed: 77 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99
| Param | Description
1010
| ----------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
11-
| [afterPopulate](#afterpopulate) | Performs any post-population processing on elements.
1211
| [andRelatedTo](#andrelatedto) | Narrows the query results to only elements that are related to certain other elements.
12+
| [andWith](#andwith) | Causes the query to return matching elements eager-loaded with related elements, in addition to the elements that were already specified by [with](#with).
1313
| [asArray](#asarray) | Causes the query to return matching elements as arrays of data, rather than ElementClass objects.
1414
| [cache](#cache) | Enables query cache for this Query.
1515
| [clearCachedResult](#clearcachedresult) | Clears the [cached result](https://craftcms.com/docs/4.x/element-queries.html#cache).
@@ -32,26 +32,16 @@
3232
| [trashed](#trashed) | Narrows the query results to only elements that have been soft-deleted.
3333
| [uid](#uid) | Narrows the query results based on the elements’ UIDs.
3434
| [with](#with) | Causes the query to return matching elements eager-loaded with related elements.
35+
| [withCustomFields](#withcustomfields) | Sets whether custom fields should be factored into the query.
3536

3637

3738
<!-- textlint-enable -->
3839

3940

40-
#### `afterPopulate`
41-
42-
Performs any post-population processing on elements.
43-
44-
45-
46-
47-
48-
49-
50-
51-
52-
5341
#### `andRelatedTo`
5442

43+
<a class="ref-defined-by" href="https://docs.craftcms.com/api/v4/craft-elements-db-elementquery.html#method-andrelatedto" target="_blank" rel="noopener noreferer">Defined by <code>craft\elements\db\ElementQuery</code></a>
44+
5545
Narrows the query results to only elements that are related to certain other elements.
5646

5747

@@ -79,8 +69,25 @@ $elements = ElementClass::find()
7969
:::
8070

8171

72+
#### `andWith`
73+
74+
<a class="ref-defined-by" href="https://docs.craftcms.com/api/v4/craft-elements-db-elementquery.html#method-andwith" target="_blank" rel="noopener noreferer">Defined by <code>craft\elements\db\ElementQuery</code></a>
75+
76+
Causes the query to return matching elements eager-loaded with related elements, in addition to the elements that were already specified by [with](#with).
77+
78+
79+
80+
.
81+
82+
83+
84+
85+
86+
8287
#### `asArray`
8388

89+
<a class="ref-defined-by" href="https://docs.craftcms.com/api/v4/craft-elements-db-elementquery.html#method-asarray" target="_blank" rel="noopener noreferer">Defined by <code>craft\elements\db\ElementQuery</code></a>
90+
8491
Causes the query to return matching elements as arrays of data, rather than ElementClass objects.
8592

8693

@@ -106,6 +113,8 @@ $elements = ElementClass::find()
106113

107114
#### `cache`
108115

116+
<a class="ref-defined-by" href="https://docs.craftcms.com/api/v4/craft-elements-db-elementquery.html#method-cache" target="_blank" rel="noopener noreferer">Defined by <code>craft\elements\db\ElementQuery</code></a>
117+
109118
Enables query cache for this Query.
110119

111120

@@ -119,6 +128,8 @@ Enables query cache for this Query.
119128

120129
#### `clearCachedResult`
121130

131+
<a class="ref-defined-by" href="https://docs.craftcms.com/api/v4/craft-elements-db-elementquery.html#method-clearcachedresult" target="_blank" rel="noopener noreferer">Defined by <code>craft\elements\db\ElementQuery</code></a>
132+
122133
Clears the [cached result](https://craftcms.com/docs/4.x/element-queries.html#cache).
123134

124135

@@ -128,6 +139,8 @@ Clears the [cached result](https://craftcms.com/docs/4.x/element-queries.html#ca
128139

129140
#### `dateCreated`
130141

142+
<a class="ref-defined-by" href="https://docs.craftcms.com/api/v4/craft-elements-db-elementquery.html#method-datecreated" target="_blank" rel="noopener noreferer">Defined by <code>craft\elements\db\ElementQuery</code></a>
143+
131144
Narrows the query results based on the elements’ creation dates.
132145

133146

@@ -168,6 +181,8 @@ $elements = ElementClass::find()
168181

169182
#### `dateUpdated`
170183

184+
<a class="ref-defined-by" href="https://docs.craftcms.com/api/v4/craft-elements-db-elementquery.html#method-dateupdated" target="_blank" rel="noopener noreferer">Defined by <code>craft\elements\db\ElementQuery</code></a>
185+
171186
Narrows the query results based on the elements’ last-updated dates.
172187

173188

@@ -206,6 +221,8 @@ $elements = ElementClass::find()
206221

207222
#### `fixedOrder`
208223

224+
<a class="ref-defined-by" href="https://docs.craftcms.com/api/v4/craft-elements-db-elementquery.html#method-fixedorder" target="_blank" rel="noopener noreferer">Defined by <code>craft\elements\db\ElementQuery</code></a>
225+
209226
Causes the query results to be returned in the order specified by [id](#id).
210227

211228

@@ -237,6 +254,8 @@ $elements = ElementClass::find()
237254

238255
#### `id`
239256

257+
<a class="ref-defined-by" href="https://docs.craftcms.com/api/v4/craft-elements-db-elementquery.html#method-id" target="_blank" rel="noopener noreferer">Defined by <code>craft\elements\db\ElementQuery</code></a>
258+
240259
Narrows the query results based on the elements’ IDs.
241260

242261

@@ -277,6 +296,8 @@ This can be combined with [fixedOrder](#fixedorder) if you want the results to b
277296

278297
#### `ignorePlaceholders`
279298

299+
<a class="ref-defined-by" href="https://docs.craftcms.com/api/v4/craft-elements-db-elementquery.html#method-ignoreplaceholders" target="_blank" rel="noopener noreferer">Defined by <code>craft\elements\db\ElementQuery</code></a>
300+
280301
Causes the query to return matching elements as they are stored in the database, ignoring matching placeholder
281302
elements that were set by [craft\services\Elements::setPlaceholderElement()](https://docs.craftcms.com/api/v4/craft-services-elements.html#method-setplaceholderelement).
282303

@@ -291,6 +312,8 @@ elements that were set by [craft\services\Elements::setPlaceholderElement()](htt
291312

292313
#### `inReverse`
293314

315+
<a class="ref-defined-by" href="https://docs.craftcms.com/api/v4/craft-elements-db-elementquery.html#method-inreverse" target="_blank" rel="noopener noreferer">Defined by <code>craft\elements\db\ElementQuery</code></a>
316+
294317
Causes the query results to be returned in reverse order.
295318

296319

@@ -316,6 +339,8 @@ $elements = ElementClass::find()
316339

317340
#### `language`
318341

342+
<a class="ref-defined-by" href="https://docs.craftcms.com/api/v4/craft-elements-db-elementquery.html#method-language" target="_blank" rel="noopener noreferer">Defined by <code>craft\elements\db\ElementQuery</code></a>
343+
319344
Determines which site(s) the elements should be queried in, based on their language.
320345

321346

@@ -354,6 +379,8 @@ $elements = ElementClass::find()
354379

355380
#### `limit`
356381

382+
<a class="ref-defined-by" href="https://www.yiiframework.com/doc/api/2.0/yii-db-querytrait#limit()-detail" target="_blank" rel="noopener noreferer">Defined by <code>yii\db\QueryTrait</code></a>
383+
357384
Determines the number of elements that should be returned.
358385

359386

@@ -377,6 +404,8 @@ $elements = ElementClass::find()
377404

378405
#### `offset`
379406

407+
<a class="ref-defined-by" href="https://www.yiiframework.com/doc/api/2.0/yii-db-querytrait#offset()-detail" target="_blank" rel="noopener noreferer">Defined by <code>yii\db\QueryTrait</code></a>
408+
380409
Determines how many elements should be skipped in the results.
381410

382411

@@ -400,6 +429,8 @@ $elements = ElementClass::find()
400429

401430
#### `orderBy`
402431

432+
<a class="ref-defined-by" href="https://docs.craftcms.com/api/v4/craft-elements-db-elementquery.html#method-orderby" target="_blank" rel="noopener noreferer">Defined by <code>craft\elements\db\ElementQuery</code></a>
433+
403434
Determines the order that the elements should be returned in. (If empty, defaults to `dateCreated DESC,
404435
elements.id`.)
405436

@@ -424,6 +455,8 @@ $elements = ElementClass::find()
424455

425456
#### `preferSites`
426457

458+
<a class="ref-defined-by" href="https://docs.craftcms.com/api/v4/craft-elements-db-elementquery.html#method-prefersites" target="_blank" rel="noopener noreferer">Defined by <code>craft\elements\db\ElementQuery</code></a>
459+
427460
If [unique()](https://docs.craftcms.com/api/v4/craft-elements-db-elementquery.html#method-unique) is set, this determines which site should be selected when querying multi-site elements.
428461

429462

@@ -459,6 +492,8 @@ $elements = ElementClass::find()
459492

460493
#### `prepareSubquery`
461494

495+
<a class="ref-defined-by" href="https://docs.craftcms.com/api/v4/craft-elements-db-elementquery.html#method-preparesubquery" target="_blank" rel="noopener noreferer">Defined by <code>craft\elements\db\ElementQuery</code></a>
496+
462497
Prepares the element query and returns its subquery (which determines what elements will be returned).
463498

464499

@@ -468,6 +503,8 @@ Prepares the element query and returns its subquery (which determines what eleme
468503

469504
#### `relatedTo`
470505

506+
<a class="ref-defined-by" href="https://docs.craftcms.com/api/v4/craft-elements-db-elementquery.html#method-relatedto" target="_blank" rel="noopener noreferer">Defined by <code>craft\elements\db\ElementQuery</code></a>
507+
471508
Narrows the query results to only elements that are related to certain other elements.
472509

473510

@@ -495,6 +532,8 @@ $elements = ElementClass::find()
495532

496533
#### `search`
497534

535+
<a class="ref-defined-by" href="https://docs.craftcms.com/api/v4/craft-elements-db-elementquery.html#method-search" target="_blank" rel="noopener noreferer">Defined by <code>craft\elements\db\ElementQuery</code></a>
536+
498537
Narrows the query results to only elements that match a search query.
499538

500539

@@ -528,6 +567,8 @@ $elements = ElementClass::find()
528567

529568
#### `siteSettingsId`
530569

570+
<a class="ref-defined-by" href="https://docs.craftcms.com/api/v4/craft-elements-db-elementquery.html#method-sitesettingsid" target="_blank" rel="noopener noreferer">Defined by <code>craft\elements\db\ElementQuery</code></a>
571+
531572
Narrows the query results based on the elements’ IDs in the `elements_sites` table.
532573

533574

@@ -562,6 +603,7 @@ $element = ElementClass::find()
562603

563604
#### `sku`
564605

606+
565607
Narrows the query results based on the SKU.
566608

567609
Possible values include:
@@ -593,6 +635,8 @@ $element = ElementClass::find()
593635

594636
#### `trashed`
595637

638+
<a class="ref-defined-by" href="https://docs.craftcms.com/api/v4/craft-elements-db-elementquery.html#method-trashed" target="_blank" rel="noopener noreferer">Defined by <code>craft\elements\db\ElementQuery</code></a>
639+
596640
Narrows the query results to only elements that have been soft-deleted.
597641

598642

@@ -618,6 +662,8 @@ $elements = ElementClass::find()
618662

619663
#### `uid`
620664

665+
<a class="ref-defined-by" href="https://docs.craftcms.com/api/v4/craft-elements-db-elementquery.html#method-uid" target="_blank" rel="noopener noreferer">Defined by <code>craft\elements\db\ElementQuery</code></a>
666+
621667
Narrows the query results based on the elements’ UIDs.
622668

623669

@@ -643,6 +689,8 @@ $element = ElementClass::find()
643689

644690
#### `with`
645691

692+
<a class="ref-defined-by" href="https://docs.craftcms.com/api/v4/craft-elements-db-elementquery.html#method-with" target="_blank" rel="noopener noreferer">Defined by <code>craft\elements\db\ElementQuery</code></a>
693+
646694
Causes the query to return matching elements eager-loaded with related elements.
647695

648696

@@ -668,5 +716,20 @@ $elements = ElementClass::find()
668716
:::
669717

670718

719+
#### `withCustomFields`
720+
721+
<a class="ref-defined-by" href="https://docs.craftcms.com/api/v4/craft-elements-db-elementquery.html#method-withcustomfields" target="_blank" rel="noopener noreferer">Defined by <code>craft\elements\db\ElementQuery</code></a>
722+
723+
Sets whether custom fields should be factored into the query.
724+
725+
726+
727+
728+
729+
730+
731+
732+
733+
671734

672735
<!-- END PARAMS -->

0 commit comments

Comments
 (0)