Remove deprecated initializers

parent a78729b0
...@@ -31,10 +31,8 @@ ...@@ -31,10 +31,8 @@
@interface BUYLineItem : _BUYLineItem {} @interface BUYLineItem : _BUYLineItem {}
- (instancetype)initWithVariant:(BUYProductVariant *)variant NS_DEPRECATED_IOS(8_0, 9_0, "Use `BUYModelManager` to create new instances of model objects instead"); - (void)updateWithVariant:(BUYProductVariant *)variant;
- (instancetype)initWithCartLineItem:(BUYCartLineItem *)cartLineItem NS_DEPRECATED_IOS(8_0, 9_0, "Use `BUYModelManager` to create new instances of model objects instead"); - (void)updateWithLineItem:(BUYCartLineItem *)lineItem;
@property (readonly) NSString *lineItemIdentifier NS_DEPRECATED_IOS(8_0, 9_0);
@end @end
......
...@@ -34,24 +34,6 @@ ...@@ -34,24 +34,6 @@
@implementation BUYLineItem @implementation BUYLineItem
/**
* Have model manager responsible for instantiation, and allow deprecated
* initializers for backwards compatability
*/
- (instancetype)initWithCartLineItem:(BUYCartLineItem *)cartLineItem
{
BUYLineItem *lineItem = [[BUYLineItem alloc] initWithModelManager:cartLineItem.modelManager JSONDictionary:nil];
[lineItem updateWithLineItem:cartLineItem];
return lineItem;
}
- (instancetype)initWithVariant:(BUYProductVariant *)variant
{
BUYLineItem *lineItem = [[BUYLineItem alloc] initWithModelManager:variant.modelManager JSONDictionary:nil];
[lineItem updateWithVariant:variant];
return lineItem;
}
- (void)updateWithVariant:(BUYProductVariant *)variant - (void)updateWithVariant:(BUYProductVariant *)variant
{ {
self.variantId = variant.identifier; self.variantId = variant.identifier;
...@@ -69,11 +51,6 @@ ...@@ -69,11 +51,6 @@
self.quantity = lineItem.quantity; self.quantity = lineItem.quantity;
} }
- (NSString *)lineItemIdentifier
{
return self.identifier;
}
@end @end
@implementation BUYModelManager (BUYLineItemCreation) @implementation BUYModelManager (BUYLineItemCreation)
......
...@@ -115,7 +115,9 @@ ...@@ -115,7 +115,9 @@
- (void)updateWithCart:(BUYCart *)cart - (void)updateWithCart:(BUYCart *)cart
{ {
NSArray *lineItems = [[cart.lineItems array] buy_map:^id(BUYCartLineItem *cartLineItem) { NSArray *lineItems = [[cart.lineItems array] buy_map:^id(BUYCartLineItem *cartLineItem) {
return [[BUYLineItem alloc] initWithCartLineItem:cartLineItem]; BUYLineItem *lineItem = [self.modelManager buy_objectWithEntityName:[BUYLineItem entityName] JSONDictionary:nil];
[lineItem updateWithLineItem:cartLineItem];
return lineItem;
}]; }];
self.lineItems = [NSOrderedSet orderedSetWithArray:lineItems]; self.lineItems = [NSOrderedSet orderedSetWithArray:lineItems];
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment