docs: function (factory, id) {
  
                      if (_.isFunction(factory)) {
  
                          var entityClassName = factory.prototype.constructor.name;
  
                          if (!entityClassName) {
                              throw new Error("No model class name defined");
                          }
  
                          var cachedItem;
  
                          // only get from cache if we got an id
                          if (id) {
                              cachedItem = this.getInstanceByCacheId(Context.generateCacheIdForEntity(entityClassName, id));
                          }
  
                          if (!cachedItem) {
                              var hash = {};
                              hash[factory.prototype.idField] = id;
                              // create new Entity
                              cachedItem = new factory(hash);
  
                              this.addEntity(cachedItem, true);
                          }
  
                          return cachedItem;
  
                      } else {
                          throw "Factory has to be a function";
                      }
                  }