Advertisement
Guest User

Untitled

a guest
Apr 3rd, 2015
322
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. var Search = function(searchDoc) {
  2. if(!_.isEmpty(searchDoc)) this.setSearch(searchDoc);
  3. }
  4. Search.prototype.search = {};
  5.  
  6. Search.prototype.set = function(key, value) {
  7. this.search[key] = value;
  8. }
  9. Search.prototype.get = function(key) {
  10. return this.search[key];
  11. }
  12.  
  13. Search.prototype.setSearch = function(searchDoc) {
  14. this.search = _.assign(this.search, searchDoc);
  15.  
  16. this.search.type = 'search';
  17. this.search.id = this.search._id;
  18. this.search.name = this.search.name;
  19. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement