FEMRelationshipAssignmentContext.m 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. //
  2. // Created by zen on 13/05/15.
  3. // Copyright (c) 2015 Yalantis. All rights reserved.
  4. //
  5. #import "FEMRelationshipAssignmentContext.h"
  6. #import "FEMRelationshipAssignmentContext+Internal.h"
  7. #import "FEMRelationship.h"
  8. #import "FEMObjectStore.h"
  9. @interface FEMRelationshipAssignmentContext ()
  10. @property (nonatomic, strong) id destinationObject;
  11. @property (nonatomic, strong) FEMRelationship *relationship;
  12. @property (nonatomic, strong) id sourceRelationshipValue;
  13. @property (nonatomic, strong) id targetRelationshipValue;
  14. @property (nonatomic, unsafe_unretained) id<FEMRelationshipAssignmentContextDelegate> delegate;
  15. @end
  16. @implementation FEMRelationshipAssignmentContext
  17. - (instancetype)initWithStore:(FEMObjectStore *)store {
  18. self = [super init];
  19. if (self) {
  20. _store = store;
  21. self.delegate = store;
  22. }
  23. return self;
  24. }
  25. - (void)deleteRelationshipObject:(id)object {
  26. [self.delegate assignmentContext:self deletedObject:object];
  27. }
  28. @end
  29. @implementation FEMRelationshipAssignmentContext (Internal)
  30. @dynamic destinationObject;
  31. @dynamic relationship;
  32. @dynamic sourceRelationshipValue;
  33. @dynamic targetRelationshipValue;
  34. @end