File tree Expand file tree Collapse file tree 3 files changed +20
-8
lines changed
AVOS/Sources/Foundation/Query Expand file tree Collapse file tree 3 files changed +20
-8
lines changed Original file line number Diff line number Diff line change @@ -109,12 +109,18 @@ NS_ASSUME_NONNULL_BEGIN
109109 */
110110- (void )includeKey : (NSString *)key ;
111111
112+ // / Reset included keys.
113+ - (void )resetIncludeKey ;
114+
112115/* !
113116 Make the query restrict the fields of the returned LCObjects to include only the provided keys.
114117 If this is called multiple times, then all of the keys specified in each of the calls will be included.
115118 @param keys The keys to include in the result.
116119 */
117- - (void )selectKeys : (NSArray *)keys ;
120+ - (void )selectKeys : (NSArray <NSString *> *)keys ;
121+
122+ // / Reset selected keys.
123+ - (void )resetSelectKey ;
118124
119125/* !
120126 Add a constraint that requires a particular key exists.
Original file line number Diff line number Diff line change @@ -171,19 +171,25 @@ - (void)doInitialization {
171171 _maxCacheAge = 24 * 3600 ;
172172}
173173
174- - (void )includeKey : (NSString *)key
175- {
174+ - (void )includeKey : (NSString *)key {
176175 [self .include addObject: key];
177176}
178177
179- - (void )selectKeys : (NSArray *)keys
180- {
181- if (self.selectedKeys == nil ) {
182- _selectedKeys = [[NSMutableSet alloc ] initWithCapacity: keys.count];
178+ - (void )resetIncludeKey {
179+ self.include = [[NSMutableSet alloc ] init ];
180+ }
181+
182+ - (void )selectKeys : (NSArray <NSString *> *)keys {
183+ if (!self.selectedKeys ) {
184+ self.selectedKeys = [[NSMutableSet alloc ] initWithCapacity: keys.count];
183185 }
184186 [self .selectedKeys addObjectsFromArray: keys];
185187}
186188
189+ - (void )resetSelectKey {
190+ self.selectedKeys = nil ;
191+ }
192+
187193- (void )addWhereItem : (id )dict forKey : (NSString *)key {
188194 if ([dict objectForKey: @" $eq" ]) {
189195 if ([self .where objectForKey: @" $and" ]) {
Original file line number Diff line number Diff line change 1111@interface LCQuery ()
1212@property (nonatomic , readwrite , strong ) NSMutableDictionary *parameters;
1313@property (nonatomic , readwrite , strong ) NSMutableDictionary *where;
14- @property (nonatomic , readwrite , strong ) NSMutableSet * selectedKeys;
14+ @property (nonatomic ) NSMutableSet <NSString *> * selectedKeys;
1515@property (nonatomic , strong ) NSMutableDictionary *extraParameters;
1616
1717- (NSDictionary *)assembleParameters ;
You can’t perform that action at this time.
0 commit comments