SBRepository Class Reference
| Inherits from | NSObject |
| Declared in | SBRepository.h SBRepository.m |
Tasks
-
+ sharedRepositoryReturns the singleton repository object.
-
+ toWishlistFromSBBook:Creates new Book object in the database and inserts it into wishlist of active user.
-
+ bookFromSBBook:Creates new Book object in the database and inserts it into the collection of active user.
-
+ getBookWithISBN:forUser:Queries books with ISBN and user.
-
+ userWithEmail:withName:withSurname:withPassword:Creates and returns a User object in the repository.
-
+ getUserWithEmail:withPassword:Queries users with email and password.
-
+ trackForBook:lendDate:toWhom:comment:Creates and returns a Track object in the repository.
-
+ booksForUser:Queries books for a user.
-
+ favoriteListForUser:Queries favorite books of a user.
-
+ readListForUser:Queries books in the readlist of a user.
-
+ wishListForUser:Queries books in the wishlist of a user.
Class Methods
bookFromSBBook:
Creates new Book object in the database and inserts it into the collection of active user.
+ (Book *)bookFromSBBook:(SBBook *)bookParameters
- book
Book object to be inserted.
Return Value
Created NSManagedObject.
Discussion
Creates new Book object in the database and inserts it into the collection of active user.
Declared In
SBRepository.hbooksForUser:
Queries books for a user.
+ (NSArray *)booksForUser:(User *)userParameters
- user
User for requested books.
Return Value
Array of Books queried.
Discussion
Queries books for a user.
Declared In
SBRepository.hfavoriteListForUser:
Queries favorite books of a user.
+ (NSFetchedResultsController *)favoriteListForUser:(User *)userParameters
- user
User for requested favorite books.
Return Value
List of favorite books as NSFetchedResultsController.
Discussion
Queries favorite books of a user.
Declared In
SBRepository.hgetBookWithISBN:forUser:
Queries books with ISBN and user.
+ (Book *)getBookWithISBN:(NSString *)isbn forUser:(User *)userReturn Value
Requested NSManagedObject. nil if not found.
Discussion
Queries books with ISBN and user.
Declared In
SBRepository.hgetUserWithEmail:withPassword:
Queries users with email and password.
+ (User *)getUserWithEmail:(NSString *)email withPassword:(NSString *)passwordParameters
Email of the user.
- password
Password of the user.
Return Value
Requested NSManagedObject. nil if not found.
Discussion
Queries users with email and password.
Declared In
SBRepository.hreadListForUser:
Queries books in the readlist of a user.
+ (NSFetchedResultsController *)readListForUser:(User *)userParameters
- user
User for requested books.
Return Value
List of books in the readlist as NSFetchedResultsController.
Discussion
Queries books in the readlist of a user.
Declared In
SBRepository.hsharedRepository
Returns the singleton repository object.
+ (SBRepository *)sharedRepositoryReturn Value
Shared repository object.
Discussion
Returns the singleton repository object.
Declared In
SBRepository.htoWishlistFromSBBook:
Creates new Book object in the database and inserts it into wishlist of active user.
+ (Book *)toWishlistFromSBBook:(SBBook *)bookParameters
- book
Book object to be inserted.
Return Value
Created NSManagedObject.
Discussion
Creates new Book object in the database and inserts it into wishlist of active user.
Declared In
SBRepository.htrackForBook:lendDate:toWhom:comment:
Creates and returns a Track object in the repository.
+ (Track *)trackForBook:(Book *)book lendDate:(NSDate *)date toWhom:(NSString *)borrower comment:(NSString *)commentParameters
- book
Book object which you keep track of.
- date
Date the Book has lent.
- borrower
Person to whom the Book has lent.
- comment
Comment about track record.
Return Value
Created NSManagedObject.
Discussion
Creates and returns a Track object in the repository.
Declared In
SBRepository.huserWithEmail:withName:withSurname:withPassword:
Creates and returns a User object in the repository.
+ (User *)userWithEmail:(NSString *)email withName:(NSString *)name withSurname:(NSString *)surname withPassword:(NSString *)passwordParameters
Email of the user.
- name
Name of the user.
- surname
Surname of the user.
- password
Password of the user.
Return Value
Created NSManagedObject.
Discussion
Creates and returns a User object in the repository.
Declared In
SBRepository.hwishListForUser:
Queries books in the wishlist of a user.
+ (NSFetchedResultsController *)wishListForUser:(User *)userParameters
- user
User for requested books.
Return Value
List of books in the wishlist as NSFetchedResultsController.
Discussion
Queries books in the wishlist of a user.
Declared In
SBRepository.h