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 6969
7070- (void )includeKey : (NSString *)key ;
7171- (void )includeKeys : (NSArray <NSString *> *)keys ;
72+ - (void )includeAll ;
7273
7374// /--------------------------------------
7475#pragma mark - Excludes
Original file line number Diff line number Diff line change @@ -166,6 +166,10 @@ - (void)includeKeys:(NSArray<NSString *> *)keys {
166166 }
167167}
168168
169+ - (void )includeAll {
170+ [self includeKey: @" *" ];
171+ }
172+
169173// /--------------------------------------
170174#pragma mark - Excludes
171175// /--------------------------------------
Original file line number Diff line number Diff line change @@ -107,6 +107,13 @@ typedef void (^PFQueryArrayResultBlock)(NSArray<PFGenericObject> *_Nullable obje
107107 */
108108- (instancetype )includeKeys : (NSArray <NSString *> *)keys ;
109109
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+
110117/* *
111118 Make the query restrict the fields of the returned `PFObject`s to exclude the provided key.
112119
Original file line number Diff line number Diff line change @@ -426,6 +426,12 @@ - (instancetype)includeKeys:(NSArray<NSString *> *)keys {
426426 return self;
427427}
428428
429+ - (instancetype )includeAll {
430+ [self checkIfCommandIsRunning ];
431+ [self .state includeAll ];
432+ return self;
433+ }
434+
429435// /--------------------------------------
430436#pragma mark - Exclude
431437// /--------------------------------------
Original file line number Diff line number Diff line change @@ -215,6 +215,14 @@ - (void)testIncludeMultipleKeys {
215215 XCTAssertEqualObjects (state.includedKeys , includedKeys);
216216}
217217
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+
218226- (void )testExcludeKeys {
219227 PFMutableQueryState *state = [[PFMutableQueryState alloc ] initWithParseClassName: @" Yarr" ];
220228 [state excludeKey: @" a" ];
You can’t perform that action at this time.
0 commit comments