Advertisement
tamasys

itemMappings Podio

Feb 10th, 2014
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //  PSItemFieldMapping.m
  2. #import "PSItemFieldMapping.h"
  3. @implementation PSItemFieldMapping
  4. - (void)buildMappings {
  5.     [self hasProperty:@"fieldId" forAttribute:@"field_id"];
  6.     [self hasProperty:@"fieldType" forAttribute:@"type"];
  7.    
  8.     [self hasProperty:@"label" forAttribute:@"config/label"];
  9.     [self hasProperty:@"required" forAttribute:@"config/required"];
  10.    
  11.     // Map values to simple NSArray property
  12.     [self hasProperty:@"values" forAttribute:@"values"];
  13. }
  14. @end
  15.  
  16. //  PSItemMapping.m
  17. #import "PSItemMapping.h"
  18. #import "PSItemFieldMapping.h"
  19. @implementation PSItemMapping
  20. - (void)buildMappings {
  21.     [self hasProperty:@"itemId" forAttribute:@"item_id"];
  22.     //Fields
  23.     [self hasRelationship: @"fields"
  24.              forAttribute: @"fields"
  25.           inverseProperty: @"item"
  26.             objectMapping: [PSItemFieldMapping mapping]];
  27. }
  28. @end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement