Skip to content

Commit 46be50d

Browse files
committed
commerce@2cf8bb8
Finish 5.2.5
1 parent 6c009ba commit 46be50d

File tree

2 files changed

+128
-12
lines changed

2 files changed

+128
-12
lines changed

docs/.artifacts/commerce/5.x/orders-carts.md

Lines changed: 64 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@
99
| Param | Description
1010
| --------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1111
| [afterPopulate](#afterpopulate) | Performs any post-population processing on elements.
12+
| [andNotRelatedTo](#andnotrelatedto) | Narrows the query results to only orders that are not related to certain other elements.
1213
| [andRelatedTo](#andrelatedto) | Narrows the query results to only orders that are related to certain other elements.
1314
| [asArray](#asarray) | Causes the query to return matching orders as arrays of data, rather than [Order](commerce5:craft\commerce\elements\Order) objects.
1415
| [cache](#cache) | Enables query cache for this Query.
15-
| [clearCachedResult](#clearcachedresult) | Clears the [cached result](https://craftcms.com/docs/4.x/element-queries.html#cache).
16+
| [clearCachedResult](#clearcachedresult) | Clears the [cached result](https://craftcms.com/docs/5.x/development/element-queries.html#cache).
1617
| [customer](#customer) | Narrows the query results based on the customer’s user account.
1718
| [customerId](#customerid) | Narrows the query results based on the customer, per their user ID.
1819
| [dateAuthorized](#dateauthorized) | Narrows the query results based on the orders’ authorized dates.
@@ -40,6 +41,7 @@
4041
| [itemTotal](#itemtotal) | Narrows the query results based on the order’s item total.
4142
| [language](#language) | Determines which site(s) the orders should be queried in, based on their language.
4243
| [limit](#limit) | Determines the number of orders that should be returned.
44+
| [notRelatedTo](#notrelatedto) | Narrows the query results to only orders that are not related to certain other elements.
4345
| [number](#number) | Narrows the query results based on the order number.
4446
| [offset](#offset) | Determines how many orders should be skipped in the results.
4547
| [orderBy](#orderby) | Determines the order that the orders should be returned in. (If empty, defaults to `id ASC`.)
@@ -96,13 +98,42 @@ Performs any post-population processing on elements.
9698

9799

98100

101+
#### `andNotRelatedTo`
102+
103+
Narrows the query results to only orders that are not related to certain other elements.
104+
105+
106+
107+
See [Relations](https://craftcms.com/docs/5.x/system/relations.html) for a full explanation of how to work with this parameter.
108+
109+
110+
111+
::: code
112+
```twig
113+
{# Fetch all orders that are related to myCategoryA and not myCategoryB #}
114+
{% set orders = craft.orders()
115+
.relatedTo(myCategoryA)
116+
.andNotRelatedTo(myCategoryB)
117+
.all() %}
118+
```
119+
120+
```php
121+
// Fetch all orders that are related to $myCategoryA and not $myCategoryB
122+
$orders = \craft\commerce\elements\Order::find()
123+
->relatedTo($myCategoryA)
124+
->andNotRelatedTo($myCategoryB)
125+
->all();
126+
```
127+
:::
128+
129+
99130
#### `andRelatedTo`
100131

101132
Narrows the query results to only orders that are related to certain other elements.
102133

103134

104135

105-
See [Relations](https://craftcms.com/docs/4.x/relations.html) for a full explanation of how to work with this parameter.
136+
See [Relations](https://craftcms.com/docs/5.x/system/relations.html) for a full explanation of how to work with this parameter.
106137

107138

108139

@@ -165,7 +196,7 @@ Enables query cache for this Query.
165196

166197
#### `clearCachedResult`
167198

168-
Clears the [cached result](https://craftcms.com/docs/4.x/element-queries.html#cache).
199+
Clears the [cached result](https://craftcms.com/docs/5.x/development/element-queries.html#cache).
169200

170201

171202

@@ -843,6 +874,33 @@ $orders = \craft\commerce\elements\Order::find()
843874
:::
844875

845876

877+
#### `notRelatedTo`
878+
879+
Narrows the query results to only orders that are not related to certain other elements.
880+
881+
882+
883+
See [Relations](https://craftcms.com/docs/5.x/system/relations.html) for a full explanation of how to work with this parameter.
884+
885+
886+
887+
::: code
888+
```twig
889+
{# Fetch all orders that are related to myEntry #}
890+
{% set orders = craft.orders()
891+
.notRelatedTo(myEntry)
892+
.all() %}
893+
```
894+
895+
```php
896+
// Fetch all orders that are related to $myEntry
897+
$orders = \craft\commerce\elements\Order::find()
898+
->notRelatedTo($myEntry)
899+
->all();
900+
```
901+
:::
902+
903+
846904
#### `number`
847905

848906
Narrows the query results based on the order number.
@@ -1181,7 +1239,7 @@ Narrows the query results to only orders that are related to certain other eleme
11811239

11821240

11831241

1184-
See [Relations](https://craftcms.com/docs/4.x/relations.html) for a full explanation of how to work with this parameter.
1242+
See [Relations](https://craftcms.com/docs/5.x/system/relations.html) for a full explanation of how to work with this parameter.
11851243

11861244

11871245

@@ -1217,7 +1275,7 @@ Narrows the query results to only orders that match a search query.
12171275

12181276

12191277

1220-
See [Searching](https://craftcms.com/docs/4.x/searching.html) for a full explanation of how to work with this parameter.
1278+
See [Searching](https://craftcms.com/docs/5.x/system/searching.html) for a full explanation of how to work with this parameter.
12211279

12221280

12231281

@@ -1535,7 +1593,7 @@ Causes the query to return matching orders eager-loaded with related elements.
15351593

15361594

15371595

1538-
See [Eager-Loading Elements](https://craftcms.com/docs/4.x/dev/eager-loading-elements.html) for a full explanation of how to work with this parameter.
1596+
See [Eager-Loading Elements](https://craftcms.com/docs/5.x/development/eager-loading.html) for a full explanation of how to work with this parameter.
15391597

15401598

15411599

docs/.artifacts/commerce/5.x/subscriptions.md

Lines changed: 64 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@
99
| Param | Description
1010
| ------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1111
| [afterPopulate](#afterpopulate) | Performs any post-population processing on elements.
12+
| [andNotRelatedTo](#andnotrelatedto) | Narrows the query results to only subscriptions that are not related to certain other elements.
1213
| [andRelatedTo](#andrelatedto) | Narrows the query results to only subscriptions that are related to certain other elements.
1314
| [asArray](#asarray) | Causes the query to return matching subscriptions as arrays of data, rather than [Subscription](commerce5:craft\commerce\elements\Subscription) objects.
1415
| [cache](#cache) | Enables query cache for this Query.
15-
| [clearCachedResult](#clearcachedresult) | Clears the [cached result](https://craftcms.com/docs/4.x/element-queries.html#cache).
16+
| [clearCachedResult](#clearcachedresult) | Clears the [cached result](https://craftcms.com/docs/5.x/development/element-queries.html#cache).
1617
| [dateCanceled](#datecanceled) | Narrows the query results based on the subscriptions’ cancellation date.
1718
| [dateCreated](#datecreated) | Narrows the query results based on the subscriptions’ creation dates.
1819
| [dateExpired](#dateexpired) | Narrows the query results based on the subscriptions’ expiration date.
@@ -32,6 +33,7 @@
3233
| [language](#language) | Determines which site(s) the subscriptions should be queried in, based on their language.
3334
| [limit](#limit) | Determines the number of subscriptions that should be returned.
3435
| [nextPaymentDate](#nextpaymentdate) | Narrows the query results based on the subscriptions’ next payment dates.
36+
| [notRelatedTo](#notrelatedto) | Narrows the query results to only subscriptions that are not related to certain other elements.
3537
| [offset](#offset) | Determines how many subscriptions should be skipped in the results.
3638
| [onTrial](#ontrial) | Narrows the query results to only subscriptions that are on trial.
3739
| [orderBy](#orderby) | Determines the order that the subscriptions should be returned in. (If empty, defaults to `dateCreated DESC`.)
@@ -74,13 +76,42 @@ Performs any post-population processing on elements.
7476

7577

7678

79+
#### `andNotRelatedTo`
80+
81+
Narrows the query results to only subscriptions that are not related to certain other elements.
82+
83+
84+
85+
See [Relations](https://craftcms.com/docs/5.x/system/relations.html) for a full explanation of how to work with this parameter.
86+
87+
88+
89+
::: code
90+
```twig
91+
{# Fetch all subscriptions that are related to myCategoryA and not myCategoryB #}
92+
{% set subscriptions = craft.subscriptions()
93+
.relatedTo(myCategoryA)
94+
.andNotRelatedTo(myCategoryB)
95+
.all() %}
96+
```
97+
98+
```php
99+
// Fetch all subscriptions that are related to $myCategoryA and not $myCategoryB
100+
$subscriptions = \craft\commerce\elements\Subscription::find()
101+
->relatedTo($myCategoryA)
102+
->andNotRelatedTo($myCategoryB)
103+
->all();
104+
```
105+
:::
106+
107+
77108
#### `andRelatedTo`
78109

79110
Narrows the query results to only subscriptions that are related to certain other elements.
80111

81112

82113

83-
See [Relations](https://craftcms.com/docs/4.x/relations.html) for a full explanation of how to work with this parameter.
114+
See [Relations](https://craftcms.com/docs/5.x/system/relations.html) for a full explanation of how to work with this parameter.
84115

85116

86117

@@ -143,7 +174,7 @@ Enables query cache for this Query.
143174

144175
#### `clearCachedResult`
145176

146-
Clears the [cached result](https://craftcms.com/docs/4.x/element-queries.html#cache).
177+
Clears the [cached result](https://craftcms.com/docs/5.x/development/element-queries.html#cache).
147178

148179

149180

@@ -673,6 +704,33 @@ $subscriptions = \craft\commerce\elements\Subscription::find()
673704
:::
674705

675706

707+
#### `notRelatedTo`
708+
709+
Narrows the query results to only subscriptions that are not related to certain other elements.
710+
711+
712+
713+
See [Relations](https://craftcms.com/docs/5.x/system/relations.html) for a full explanation of how to work with this parameter.
714+
715+
716+
717+
::: code
718+
```twig
719+
{# Fetch all subscriptions that are related to myEntry #}
720+
{% set subscriptions = craft.subscriptions()
721+
.notRelatedTo(myEntry)
722+
.all() %}
723+
```
724+
725+
```php
726+
// Fetch all subscriptions that are related to $myEntry
727+
$subscriptions = \craft\commerce\elements\Subscription::find()
728+
->notRelatedTo($myEntry)
729+
->all();
730+
```
731+
:::
732+
733+
676734
#### `offset`
677735

678736
Determines how many subscriptions should be skipped in the results.
@@ -876,7 +934,7 @@ Narrows the query results to only subscriptions that are related to certain othe
876934

877935

878936

879-
See [Relations](https://craftcms.com/docs/4.x/relations.html) for a full explanation of how to work with this parameter.
937+
See [Relations](https://craftcms.com/docs/5.x/system/relations.html) for a full explanation of how to work with this parameter.
880938

881939

882940

@@ -912,7 +970,7 @@ Narrows the query results to only subscriptions that match a search query.
912970

913971

914972

915-
See [Searching](https://craftcms.com/docs/4.x/searching.html) for a full explanation of how to work with this parameter.
973+
See [Searching](https://craftcms.com/docs/5.x/system/searching.html) for a full explanation of how to work with this parameter.
916974

917975

918976

@@ -1158,7 +1216,7 @@ Causes the query to return matching subscriptions eager-loaded with related elem
11581216

11591217

11601218

1161-
See [Eager-Loading Elements](https://craftcms.com/docs/4.x/dev/eager-loading-elements.html) for a full explanation of how to work with this parameter.
1219+
See [Eager-Loading Elements](https://craftcms.com/docs/5.x/development/eager-loading.html) for a full explanation of how to work with this parameter.
11621220

11631221

11641222

0 commit comments

Comments
 (0)