Skip to content

Commit

Permalink
commerce@2cf8bb8
Browse files Browse the repository at this point in the history
Finish 5.2.5
  • Loading branch information
shinybrad committed Nov 20, 2024
1 parent 6c009ba commit 46be50d
Show file tree
Hide file tree
Showing 2 changed files with 128 additions and 12 deletions.
70 changes: 64 additions & 6 deletions docs/.artifacts/commerce/5.x/orders-carts.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
| Param | Description
| --------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| [afterPopulate](#afterpopulate) | Performs any post-population processing on elements.
| [andNotRelatedTo](#andnotrelatedto) | Narrows the query results to only orders that are not related to certain other elements.
| [andRelatedTo](#andrelatedto) | Narrows the query results to only orders that are related to certain other elements.
| [asArray](#asarray) | Causes the query to return matching orders as arrays of data, rather than [Order](commerce5:craft\commerce\elements\Order) objects.
| [cache](#cache) | Enables query cache for this Query.
| [clearCachedResult](#clearcachedresult) | Clears the [cached result](https://craftcms.com/docs/4.x/element-queries.html#cache).
| [clearCachedResult](#clearcachedresult) | Clears the [cached result](https://craftcms.com/docs/5.x/development/element-queries.html#cache).
| [customer](#customer) | Narrows the query results based on the customer’s user account.
| [customerId](#customerid) | Narrows the query results based on the customer, per their user ID.
| [dateAuthorized](#dateauthorized) | Narrows the query results based on the orders’ authorized dates.
Expand Down Expand Up @@ -40,6 +41,7 @@
| [itemTotal](#itemtotal) | Narrows the query results based on the order’s item total.
| [language](#language) | Determines which site(s) the orders should be queried in, based on their language.
| [limit](#limit) | Determines the number of orders that should be returned.
| [notRelatedTo](#notrelatedto) | Narrows the query results to only orders that are not related to certain other elements.
| [number](#number) | Narrows the query results based on the order number.
| [offset](#offset) | Determines how many orders should be skipped in the results.
| [orderBy](#orderby) | Determines the order that the orders should be returned in. (If empty, defaults to `id ASC`.)
Expand Down Expand Up @@ -96,13 +98,42 @@ Performs any post-population processing on elements.



#### `andNotRelatedTo`

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



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



::: code
```twig
{# Fetch all orders that are related to myCategoryA and not myCategoryB #}
{% set orders = craft.orders()
.relatedTo(myCategoryA)
.andNotRelatedTo(myCategoryB)
.all() %}
```

```php
// Fetch all orders that are related to $myCategoryA and not $myCategoryB
$orders = \craft\commerce\elements\Order::find()
->relatedTo($myCategoryA)
->andNotRelatedTo($myCategoryB)
->all();
```
:::


#### `andRelatedTo`

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



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



Expand Down Expand Up @@ -165,7 +196,7 @@ Enables query cache for this Query.

#### `clearCachedResult`

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



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


#### `notRelatedTo`

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



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



::: code
```twig
{# Fetch all orders that are related to myEntry #}
{% set orders = craft.orders()
.notRelatedTo(myEntry)
.all() %}
```

```php
// Fetch all orders that are related to $myEntry
$orders = \craft\commerce\elements\Order::find()
->notRelatedTo($myEntry)
->all();
```
:::


#### `number`

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



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



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



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



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



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.
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.



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



#### `andNotRelatedTo`

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



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



::: code
```twig
{# Fetch all subscriptions that are related to myCategoryA and not myCategoryB #}
{% set subscriptions = craft.subscriptions()
.relatedTo(myCategoryA)
.andNotRelatedTo(myCategoryB)
.all() %}
```

```php
// Fetch all subscriptions that are related to $myCategoryA and not $myCategoryB
$subscriptions = \craft\commerce\elements\Subscription::find()
->relatedTo($myCategoryA)
->andNotRelatedTo($myCategoryB)
->all();
```
:::


#### `andRelatedTo`

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



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



Expand Down Expand Up @@ -143,7 +174,7 @@ Enables query cache for this Query.

#### `clearCachedResult`

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



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


#### `notRelatedTo`

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



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



::: code
```twig
{# Fetch all subscriptions that are related to myEntry #}
{% set subscriptions = craft.subscriptions()
.notRelatedTo(myEntry)
.all() %}
```

```php
// Fetch all subscriptions that are related to $myEntry
$subscriptions = \craft\commerce\elements\Subscription::find()
->notRelatedTo($myEntry)
->all();
```
:::


#### `offset`

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



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



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



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



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



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.
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.



Expand Down

0 comments on commit 46be50d

Please sign in to comment.