You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| [administrativeArea](#administrativearea) | Narrows the query results based on the administrative area the assets belong to.
12
-
| [afterPopulate](#afterpopulate) | Performs any post-population processing on elements.
13
12
| [andRelatedTo](#andrelatedto) | Narrows the query results to only addresses that are related to certain other elements.
13
+
| [andWith](#andwith) | Causes the query to return matching addresses eager-loaded with related elements, in addition to the elements that were already specified by [with](#with).
14
14
| [asArray](#asarray) | Causes the query to return matching addresses as arrays of data, rather than [Address](craft4:craft\elements\Address) objects.
15
15
| [cache](#cache) | Enables query cache for this Query.
16
16
| [clearCachedResult](#clearcachedresult) | Clears the [cached result](https://craftcms.com/docs/4.x/element-queries.html#cache).
@@ -43,6 +43,7 @@
43
43
44
44
#### `administrativeArea`
45
45
46
+
46
47
Narrows the query results based on the administrative area the assets belong to.
Performs any post-population processing on elements.
79
-
80
-
81
-
82
-
83
-
84
-
85
-
86
-
87
-
88
-
89
77
#### `andRelatedTo`
90
78
79
+
<aclass="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>
80
+
91
81
Narrows the query results to only addresses that are related to certain other elements.
<aclass="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>
111
+
112
+
Causes the query to return matching addresses eager-loaded with related elements, in addition to the elements that were already specified by [with](#with).
113
+
114
+
115
+
116
+
.
117
+
118
+
119
+
120
+
121
+
122
+
118
123
#### `asArray`
119
124
125
+
<aclass="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>
126
+
120
127
Causes the query to return matching addresses as arrays of data, rather than [Address](craft4:craft\elements\Address) objects.
<aclass="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>
153
+
145
154
Enables query cache for this Query.
146
155
147
156
@@ -155,6 +164,8 @@ Enables query cache for this Query.
155
164
156
165
#### `clearCachedResult`
157
166
167
+
<aclass="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>
168
+
158
169
Clears the [cached result](https://craftcms.com/docs/4.x/element-queries.html#cache).
159
170
160
171
@@ -164,6 +175,7 @@ Clears the [cached result](https://craftcms.com/docs/4.x/element-queries.html#ca
164
175
165
176
#### `countryCode`
166
177
178
+
167
179
Narrows the query results based on the country the assets belong to.
<aclass="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>
212
+
199
213
Narrows the query results based on the addresses’ creation dates.
<aclass="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>
254
+
239
255
Narrows the query results based on the addresses’ last-updated dates.
<aclass="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>
294
+
277
295
Causes the query results to be returned in the order specified by [id](#id).
<aclass="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>
327
+
308
328
Narrows the query results based on the addresses’ IDs.
309
329
310
330
@@ -345,6 +365,8 @@ This can be combined with [fixedOrder](#fixedorder) if you want the results to b
345
365
346
366
#### `ignorePlaceholders`
347
367
368
+
<aclass="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>
369
+
348
370
Causes the query to return matching addresses as they are stored in the database, ignoring matching placeholder
349
371
elements that were set by [craft\services\Elements::setPlaceholderElement()](https://docs.craftcms.com/api/v4/craft-services-elements.html#method-setplaceholderelement).
350
372
@@ -359,6 +381,8 @@ elements that were set by [craft\services\Elements::setPlaceholderElement()](htt
359
381
360
382
#### `inReverse`
361
383
384
+
<aclass="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>
385
+
362
386
Causes the query results to be returned in reverse order.
<aclass="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>
412
+
387
413
Determines which site(s) the addresses should be queried in, based on their language.
<aclass="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>
452
+
425
453
Determines the number of addresses that should be returned.
<aclass="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>
477
+
448
478
Determines how many addresses should be skipped in the results.
<aclass="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>
502
+
471
503
Determines the order that the addresses should be returned in. (If empty, defaults to `dateCreated DESC,
<aclass="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>
583
+
548
584
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.
<aclass="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>
620
+
583
621
Prepares the element query and returns its subquery (which determines what elements will be returned).
584
622
585
623
@@ -589,6 +627,8 @@ Prepares the element query and returns its subquery (which determines what eleme
589
627
590
628
#### `relatedTo`
591
629
630
+
<aclass="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>
631
+
592
632
Narrows the query results to only addresses that are related to certain other elements.
<aclass="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>
660
+
619
661
Narrows the query results to only addresses that match a search query.
<aclass="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>
695
+
652
696
Narrows the query results based on the addresses’ IDs in the `elements_sites` table.
<aclass="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>
731
+
686
732
Narrows the query results to only addresses that have been soft-deleted.
<aclass="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>
758
+
711
759
Narrows the query results based on the addresses’ UIDs.
<aclass="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>
785
+
736
786
Causes the query to return matching addresses eager-loaded with related elements.
<aclass="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>
814
+
763
815
Sets whether custom fields should be factored into the query.
0 commit comments