#import "MyCoreData.h"
#import "SDK.h"
#import <PINCache/PINCache.h>

@implementation MyCoreData

-(NSString *)guestCheckoutPromotionText{
	return (NSString *)[[PINDiskCache sharedCache] objectForKey:NSStringFromSelector(@selector(guestCheckoutPromotionText))];
}

-(void)setGuestCheckoutPromotionText:(NSString *)guestCheckoutPromotionText{
	[[PINDiskCache sharedCache] setObject:guestCheckoutPromotionText forKey:NSStringFromSelector(@selector(guestCheckoutPromotionText))];
}

- (instancetype)init {
	if (self = [super init]) {
		[[PINCache sharedCache] removeObjectForKey:NSStringFromSelector(@selector(slide_images))];
		[[PINCache sharedCache] removeObjectForKey:NSStringFromSelector(@selector(hot_destination_images))];
	}
	return self;
}

- (NSDictionary *)tourSearchDataSource {
	NSString *key = [NSString stringWithFormat:@"%@ %@", NSStringFromSelector(@selector(tourSearchDataSource)), [IMLocalization sharedInstance].language];
	return [[PINCache sharedCache] objectForKey:key];
}

- (void)setTourSearchDataSource:(NSDictionary *)tourSearchDataSource {
	NSString *key = [NSString stringWithFormat:@"%@ %@", NSStringFromSelector(@selector(tourSearchDataSource)), [IMLocalization sharedInstance].language];
	if (tourSearchDataSource) {
		[[PINCache sharedCache] setObject:tourSearchDataSource forKey:key];
	} else {
		[[PINCache sharedCache] removeObjectForKey:key];
	}
}

- (NSDictionary *)hotelSearchDataSource {
	NSString *key = [NSString stringWithFormat:@"%@ %@", NSStringFromSelector(@selector(hotelSearchDataSource)), [IMLocalization sharedInstance].language];
	return [[PINCache sharedCache] objectForKey:key];
}

- (void)setHotelSearchDataSource:(NSDictionary *)hotelSearchDataSource {
	NSString *key = [NSString stringWithFormat:@"%@ %@", NSStringFromSelector(@selector(hotelSearchDataSource)), [IMLocalization sharedInstance].language];
	if (hotelSearchDataSource) {
		[[PINCache sharedCache] setObject:hotelSearchDataSource forKey:key];
	} else {
		[[PINCache sharedCache] removeObjectForKey:key];
	}
}

- (NSArray *)slide_images {
	NSString *key = [NSString stringWithFormat:@"%@ %@", NSStringFromSelector(@selector(slide_images)), [IMLocalization sharedInstance].language];
	return [[PINCache sharedCache] objectForKey:key];
}

- (void)setSlide_images:(NSArray *)slide_images {
	NSString *key = [NSString stringWithFormat:@"%@ %@", NSStringFromSelector(@selector(slide_images)), [IMLocalization sharedInstance].language];
	[[PINCache sharedCache] setObject:slide_images forKey:key];
}

- (NSArray *)hot_destination_images {
	NSString *key = [NSString stringWithFormat:@"%@ %@", NSStringFromSelector(@selector(hot_destination_images)), [IMLocalization sharedInstance].language];
	return [[PINCache sharedCache] objectForKey:key];
}

- (void)setHot_destination_images:(NSArray *)hot_destination_images {
	NSString *key = [NSString stringWithFormat:@"%@ %@", NSStringFromSelector(@selector(hot_destination_images)), [IMLocalization sharedInstance].language];
	[[PINCache sharedCache] setObject:hot_destination_images forKey:key];
}

@end
