File tree Expand file tree Collapse file tree 5 files changed +26
-0
lines changed Expand file tree Collapse file tree 5 files changed +26
-0
lines changed Original file line number Diff line number Diff line change 69
69
70
70
- (void )includeKey : (NSString *)key ;
71
71
- (void )includeKeys : (NSArray <NSString *> *)keys ;
72
+ - (void )includeAll ;
72
73
73
74
// /--------------------------------------
74
75
#pragma mark - Excludes
Original file line number Diff line number Diff line change @@ -166,6 +166,10 @@ - (void)includeKeys:(NSArray<NSString *> *)keys {
166
166
}
167
167
}
168
168
169
+ - (void )includeAll {
170
+ [self includeKey: @" *" ];
171
+ }
172
+
169
173
// /--------------------------------------
170
174
#pragma mark - Excludes
171
175
// /--------------------------------------
Original file line number Diff line number Diff line change @@ -107,6 +107,13 @@ typedef void (^PFQueryArrayResultBlock)(NSArray<PFGenericObject> *_Nullable obje
107
107
*/
108
108
- (instancetype )includeKeys : (NSArray <NSString *> *)keys ;
109
109
110
+ /* *
111
+ Make the query include all `PFObject`s that have a reference.
112
+
113
+ @return The same instance of `PFQuery` as the receiver. This allows method chaining.
114
+ */
115
+ - (instancetype )includeAll ;
116
+
110
117
/* *
111
118
Make the query restrict the fields of the returned `PFObject`s to exclude the provided key.
112
119
Original file line number Diff line number Diff line change @@ -426,6 +426,12 @@ - (instancetype)includeKeys:(NSArray<NSString *> *)keys {
426
426
return self;
427
427
}
428
428
429
+ - (instancetype )includeAll {
430
+ [self checkIfCommandIsRunning ];
431
+ [self .state includeAll ];
432
+ return self;
433
+ }
434
+
429
435
// /--------------------------------------
430
436
#pragma mark - Exclude
431
437
// /--------------------------------------
Original file line number Diff line number Diff line change @@ -215,6 +215,14 @@ - (void)testIncludeMultipleKeys {
215
215
XCTAssertEqualObjects (state.includedKeys , includedKeys);
216
216
}
217
217
218
+ - (void )testIncludeAll {
219
+ PFMutableQueryState *state = [[PFMutableQueryState alloc ] initWithParseClassName: @" Yarr" ];
220
+ [state includeAll ];
221
+
222
+ NSSet *includedKeys = PF_SET (@" *" );
223
+ XCTAssertEqualObjects (state.includedKeys , includedKeys);
224
+ }
225
+
218
226
- (void )testExcludeKeys {
219
227
PFMutableQueryState *state = [[PFMutableQueryState alloc ] initWithParseClassName: @" Yarr" ];
220
228
[state excludeKey: @" a" ];
You can’t perform that action at this time.
0 commit comments