Skip to content

Commit 4437ac9

Browse files
committed
cms@d01e1c2
Finish 5.4.0
1 parent 540e3e3 commit 4437ac9

File tree

7 files changed

+406
-0
lines changed

7 files changed

+406
-0
lines changed

docs/.artifacts/cms/5.x/addresses.md

+58
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
| [afterPopulate](#afterpopulate) | Performs any post-population processing on elements.
1616
| [allowOwnerDrafts](#allowownerdrafts) | Narrows the query results based on whether the addresses’ owners are drafts.
1717
| [allowOwnerRevisions](#allowownerrevisions) | Narrows the query results based on whether the addresses’ owners are revisions.
18+
| [andNotRelatedTo](#andnotrelatedto) | Narrows the query results to only addresses that are not related to certain other elements.
1819
| [andRelatedTo](#andrelatedto) | Narrows the query results to only addresses that are related to certain other elements.
1920
| [asArray](#asarray) | Causes the query to return matching addresses as arrays of data, rather than [Address](craft5:craft\elements\Address) objects.
2021
| [cache](#cache) | Enables query cache for this Query.
@@ -37,6 +38,7 @@
3738
| [lastName](#lastname) | Narrows the query results based on the last name the addresses have.
3839
| [limit](#limit) | Determines the number of addresses that should be returned.
3940
| [locality](#locality) | Narrows the query results based on the locality the addresses belong to.
41+
| [notRelatedTo](#notrelatedto) | Narrows the query results to only addresses that are not related to certain other elements.
4042
| [offset](#offset) | Determines how many addresses should be skipped in the results.
4143
| [orderBy](#orderby) | Determines the order that the addresses should be returned in. (If empty, defaults to `dateCreated DESC, elements.id`.)
4244
| [organization](#organization) | Narrows the query results based on the organization the addresses have.
@@ -231,6 +233,35 @@ Possible values include:
231233

232234

233235

236+
#### `andNotRelatedTo`
237+
238+
Narrows the query results to only addresses that are not related to certain other elements.
239+
240+
241+
242+
See [Relations](https://craftcms.com/docs/4.x/relations.html) for a full explanation of how to work with this parameter.
243+
244+
245+
246+
::: code
247+
```twig
248+
{# Fetch all addresses that are related to myCategoryA and not myCategoryB #}
249+
{% set addresses = craft.addresses()
250+
.relatedTo(myCategoryA)
251+
.andNotRelatedTo(myCategoryB)
252+
.all() %}
253+
```
254+
255+
```php
256+
// Fetch all addresses that are related to $myCategoryA and not $myCategoryB
257+
$addresses = \craft\elements\Address::find()
258+
->relatedTo($myCategoryA)
259+
->andNotRelatedTo($myCategoryB)
260+
->all();
261+
```
262+
:::
263+
264+
234265
#### `andRelatedTo`
235266

236267
Narrows the query results to only addresses that are related to certain other elements.
@@ -833,6 +864,33 @@ $addresses = \craft\elements\Address::find()
833864
:::
834865

835866

867+
#### `notRelatedTo`
868+
869+
Narrows the query results to only addresses that are not related to certain other elements.
870+
871+
872+
873+
See [Relations](https://craftcms.com/docs/4.x/relations.html) for a full explanation of how to work with this parameter.
874+
875+
876+
877+
::: code
878+
```twig
879+
{# Fetch all addresses that are related to myEntry #}
880+
{% set addresses = craft.addresses()
881+
.notRelatedTo(myEntry)
882+
.all() %}
883+
```
884+
885+
```php
886+
// Fetch all addresses that are related to $myEntry
887+
$addresses = \craft\elements\Address::find()
888+
->notRelatedTo($myEntry)
889+
->all();
890+
```
891+
:::
892+
893+
836894
#### `offset`
837895

838896
Determines how many addresses should be skipped in the results.

docs/.artifacts/cms/5.x/assets.md

+58
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
| Param | Description
1010
| ------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1111
| [afterPopulate](#afterpopulate) | Performs any post-population processing on elements.
12+
| [andNotRelatedTo](#andnotrelatedto) | Narrows the query results to only assets that are not related to certain other elements.
1213
| [andRelatedTo](#andrelatedto) | Narrows the query results to only assets that are related to certain other elements.
1314
| [asArray](#asarray) | Causes the query to return matching assets as arrays of data, rather than [Asset](craft5:craft\elements\Asset) objects.
1415
| [cache](#cache) | Enables query cache for this Query.
@@ -31,6 +32,7 @@
3132
| [kind](#kind) | Narrows the query results based on the assets’ file kinds.
3233
| [language](#language) | Determines which site(s) the assets should be queried in, based on their language.
3334
| [limit](#limit) | Determines the number of assets that should be returned.
35+
| [notRelatedTo](#notrelatedto) | Narrows the query results to only assets that are not related to certain other elements.
3436
| [offset](#offset) | Determines how many assets should be skipped in the results.
3537
| [orderBy](#orderby) | Determines the order that the assets should be returned in. (If empty, defaults to `dateCreated DESC, elements.id`.)
3638
| [preferSites](#prefersites) | If [unique](#unique) is set, this determines which site should be selected when querying multi-site elements.
@@ -75,6 +77,35 @@ Performs any post-population processing on elements.
7577

7678

7779

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

80111
Narrows the query results to only assets that are related to certain other elements.
@@ -691,6 +722,33 @@ $assets = \craft\elements\Asset::find()
691722
:::
692723

693724

725+
#### `notRelatedTo`
726+
727+
Narrows the query results to only assets that are not related to certain other elements.
728+
729+
730+
731+
See [Relations](https://craftcms.com/docs/4.x/relations.html) for a full explanation of how to work with this parameter.
732+
733+
734+
735+
::: code
736+
```twig
737+
{# Fetch all assets that are related to myEntry #}
738+
{% set assets = craft.assets()
739+
.notRelatedTo(myEntry)
740+
.all() %}
741+
```
742+
743+
```php
744+
// Fetch all assets that are related to $myEntry
745+
$assets = \craft\elements\Asset::find()
746+
->notRelatedTo($myEntry)
747+
->all();
748+
```
749+
:::
750+
751+
694752
#### `offset`
695753

696754
Determines how many assets should be skipped in the results.

docs/.artifacts/cms/5.x/categories.md

+58
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
| [afterPopulate](#afterpopulate) | Performs any post-population processing on elements.
1212
| [ancestorDist](#ancestordist) | Narrows the query results to only categories that are up to a certain distance away from the category specified by [ancestorOf](#ancestorof).
1313
| [ancestorOf](#ancestorof) | Narrows the query results to only categories that are ancestors of another category in its structure.
14+
| [andNotRelatedTo](#andnotrelatedto) | Narrows the query results to only categories that are not related to certain other elements.
1415
| [andRelatedTo](#andrelatedto) | Narrows the query results to only categories that are related to certain other elements.
1516
| [asArray](#asarray) | Causes the query to return matching categories as arrays of data, rather than [Category](craft5:craft\elements\Category) objects.
1617
| [cache](#cache) | Enables query cache for this Query.
@@ -33,6 +34,7 @@
3334
| [level](#level) | Narrows the query results based on the categories’ level within the structure.
3435
| [limit](#limit) | Determines the number of categories that should be returned.
3536
| [nextSiblingOf](#nextsiblingof) | Narrows the query results to only the category that comes immediately after another category in its structure.
37+
| [notRelatedTo](#notrelatedto) | Narrows the query results to only categories that are not related to certain other elements.
3638
| [offset](#offset) | Determines how many categories should be skipped in the results.
3739
| [orderBy](#orderby) | Determines the order that the categories should be returned in. (If empty, defaults to `dateCreated DESC, elements.id`, or the order defined by the category group if the [group](#group) or [groupId](#groupid) params are set to a single group.)
3840
| [positionedAfter](#positionedafter) | Narrows the query results to only categories that are positioned after another category in its structure.
@@ -142,6 +144,35 @@ This can be combined with [ancestorDist](#ancestordist) if you want to limit how
142144
:::
143145

144146

147+
#### `andNotRelatedTo`
148+
149+
Narrows the query results to only categories that are not related to certain other elements.
150+
151+
152+
153+
See [Relations](https://craftcms.com/docs/4.x/relations.html) for a full explanation of how to work with this parameter.
154+
155+
156+
157+
::: code
158+
```twig
159+
{# Fetch all categories that are related to myCategoryA and not myCategoryB #}
160+
{% set categories = craft.categories()
161+
.relatedTo(myCategoryA)
162+
.andNotRelatedTo(myCategoryB)
163+
.all() %}
164+
```
165+
166+
```php
167+
// Fetch all categories that are related to $myCategoryA and not $myCategoryB
168+
$categories = \craft\elements\Category::find()
169+
->relatedTo($myCategoryA)
170+
->andNotRelatedTo($myCategoryB)
171+
->all();
172+
```
173+
:::
174+
175+
145176
#### `andRelatedTo`
146177

147178
Narrows the query results to only categories that are related to certain other elements.
@@ -746,6 +777,33 @@ $category = \craft\elements\Category::find()
746777
:::
747778

748779

780+
#### `notRelatedTo`
781+
782+
Narrows the query results to only categories that are not related to certain other elements.
783+
784+
785+
786+
See [Relations](https://craftcms.com/docs/4.x/relations.html) for a full explanation of how to work with this parameter.
787+
788+
789+
790+
::: code
791+
```twig
792+
{# Fetch all categories that are related to myEntry #}
793+
{% set categories = craft.categories()
794+
.notRelatedTo(myEntry)
795+
.all() %}
796+
```
797+
798+
```php
799+
// Fetch all categories that are related to $myEntry
800+
$categories = \craft\elements\Category::find()
801+
->notRelatedTo($myEntry)
802+
->all();
803+
```
804+
:::
805+
806+
749807
#### `offset`
750808

751809
Determines how many categories should be skipped in the results.

docs/.artifacts/cms/5.x/entries.md

+58
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
| [allowOwnerRevisions](#allowownerrevisions) | Narrows the query results based on whether the entries’ owners are revisions.
1515
| [ancestorDist](#ancestordist) | Narrows the query results to only entries that are up to a certain distance away from the entry specified by [ancestorOf](#ancestorof).
1616
| [ancestorOf](#ancestorof) | Narrows the query results to only entries that are ancestors of another entry in its structure.
17+
| [andNotRelatedTo](#andnotrelatedto) | Narrows the query results to only entries that are not related to certain other elements.
1718
| [andRelatedTo](#andrelatedto) | Narrows the query results to only entries that are related to certain other elements.
1819
| [asArray](#asarray) | Causes the query to return matching entries as arrays of data, rather than [Entry](craft5:craft\elements\Entry) objects.
1920
| [authorGroup](#authorgroup) | Narrows the query results based on the user group the entries’ authors belong to.
@@ -45,6 +46,7 @@
4546
| [level](#level) | Narrows the query results based on the entries’ level within the structure.
4647
| [limit](#limit) | Determines the number of entries that should be returned.
4748
| [nextSiblingOf](#nextsiblingof) | Narrows the query results to only the entry that comes immediately after another entry in its structure.
49+
| [notRelatedTo](#notrelatedto) | Narrows the query results to only entries that are not related to certain other elements.
4850
| [offset](#offset) | Determines how many entries should be skipped in the results.
4951
| [orderBy](#orderby) | Determines the order that the entries should be returned in. (If empty, defaults to `postDate DESC, elements.id`, or the order defined by the section if the [section](#section) or [sectionId](#sectionid) params are set to a single Structure section.)
5052
| [owner](#owner) | Sets the [ownerId](#ownerid) and [siteId](#siteid) parameters based on a given element.
@@ -233,6 +235,35 @@ This can be combined with [ancestorDist](#ancestordist) if you want to limit how
233235
:::
234236

235237

238+
#### `andNotRelatedTo`
239+
240+
Narrows the query results to only entries that are not related to certain other elements.
241+
242+
243+
244+
See [Relations](https://craftcms.com/docs/4.x/relations.html) for a full explanation of how to work with this parameter.
245+
246+
247+
248+
::: code
249+
```twig
250+
{# Fetch all entries that are related to myCategoryA and not myCategoryB #}
251+
{% set entries = craft.entries()
252+
.relatedTo(myCategoryA)
253+
.andNotRelatedTo(myCategoryB)
254+
.all() %}
255+
```
256+
257+
```php
258+
// Fetch all entries that are related to $myCategoryA and not $myCategoryB
259+
$entries = \craft\elements\Entry::find()
260+
->relatedTo($myCategoryA)
261+
->andNotRelatedTo($myCategoryB)
262+
->all();
263+
```
264+
:::
265+
266+
236267
#### `andRelatedTo`
237268

238269
Narrows the query results to only entries that are related to certain other elements.
@@ -1133,6 +1164,33 @@ $entry = \craft\elements\Entry::find()
11331164
:::
11341165

11351166

1167+
#### `notRelatedTo`
1168+
1169+
Narrows the query results to only entries that are not related to certain other elements.
1170+
1171+
1172+
1173+
See [Relations](https://craftcms.com/docs/4.x/relations.html) for a full explanation of how to work with this parameter.
1174+
1175+
1176+
1177+
::: code
1178+
```twig
1179+
{# Fetch all entries that are related to myEntry #}
1180+
{% set entries = craft.entries()
1181+
.notRelatedTo(myEntry)
1182+
.all() %}
1183+
```
1184+
1185+
```php
1186+
// Fetch all entries that are related to $myEntry
1187+
$entries = \craft\elements\Entry::find()
1188+
->notRelatedTo($myEntry)
1189+
->all();
1190+
```
1191+
:::
1192+
1193+
11361194
#### `offset`
11371195

11381196
Determines how many entries should be skipped in the results.

0 commit comments

Comments
 (0)