docs: function(caller) {
  
          var entityName  = self.name.substr(0, 1).toLowerCase() + self.name.substr(1);
          var shortName   = self.name.replace(/Entity/, '');
          shortName       = shortName.substr(0, 1).toLowerCase() + shortName.substr(1);
  
          var entity      = null;
  
          if ( EntitySuper[self.name].initialized ) {
  
              self.initialized = EntitySuper[self.name].initialized;
              entity = self
  
          } else {
              EntitySuper[self.name].initialized = true;
              entity = self.getEntity(self.name)
          }
  
  
  
          var eventName = '';
          for (var prop in entity) {
              eventName = shortName +'#'+ prop;
              if ( typeof(entity[prop]) == 'function' && new RegExp('(' + eventName + '\'|' + eventName + '\"|' + eventName + '$)').test(entity[prop].toString()) ) {
                  self._methods.push(prop)
              }
          }
  
          // use this property inside your entity to disable listeners
          if ( typeof(entity.hasOwnEvents) != 'undefined' && entity.hasOwnEvents ) return false;
  
          var events = []
              , triggers = []
              , i = 0
              , cb = {}
              , methods = self._methods;
  
  
          for (var f = 0, fLen = methods.length; f < fLen; ++f) {
              if (
                  typeof(entity[methods[f]]) == 'function'
                  && f != 'onComplete'
              ) {
  
                  events[i] = {
                      shortName: shortName + '#' + methods[f],
                      method: methods[f],
                      entityName: entityName
                  };
  
                  triggers.push(shortName + '#' + methods[f]);
                  ++i;
              }
          }
  
          entity._listeners = events;
          entity._triggers = triggers;
          entity._callbacks = {};
          entity._maxListeners += i; // default max listeners is 10
          entity.setMaxListeners(entity._maxListeners || 50);
          //console.debug('['+self.name+'] setting max listeners to: ' + (entity.maxListeners || eCount) );
  
          var f           = null
              , fSource   = '';
  
          for (var i = 0; i < events.length; ++i) {
  
              entity.removeAllListeners(events[i].shortName); // added on october 1st to prevent adding new listners on each new querie
              //console.debug('placing event: '+ events[i].shortName +'\n');
              f       = events[i].method;
              fSource = entity[f].toString();
  
              // only if method content is about the event
              if (methods.indexOf(f) > -1 && new RegExp('(' + events[i].shortName + '\'|' + events[i].shortName + '\"|' + events[i].shortName + '$)').test(fSource)) {
  
  
                  entity[f] = (function onEntityEvent(e, m, i, source) {
  
                      var cached      = entity[m];
  
                      var variables   = source.match(/\((.*)\)/g)[0];
                      var args        = [];
  
                      if (variables.length) {
                          variables = variables.replace(/\(|\)/g, '').replace(/\s*/g, '');
                          if (variables) args = variables.split(/\,/g);
                      }
  
                      // TODO - retrieve argument while the method is being rewritten
                      return function () {
  
                          // retrieving local arguments, & binding it to the event callback
  
                          cached.apply(this[m], arguments);
  
                          this[m].onComplete = function (cb) {
  
                              console.debug('setting listener for: [ ' + self.model + '/' + events[i].entityName + '::' + events[i].shortName + ' ]');
  
                              //Setting local listener : normal case
                              if (entity._triggers.indexOf(events[i].shortName) > -1) {
  
                                  if (typeof(entity._arguments) == 'undefined' || typeof(entity._arguments) != 'undefined' && typeof(entity._arguments[events[i].shortName]) == 'undefined') {
                                      entity.once(events[i].shortName, function () { // cannot be `entity.on` for prod/stage
                                          // check if not already fired
                                          if (entity._callbacks[events[i].shortName])
                                              cb.apply(this[m], arguments);
                                      });
  
                                      // backing up callback
                                      entity._callbacks[events[i].shortName] = cb;
                                  } else { // in case the event is not ready yet
                                      cb.apply(entity[m], entity._arguments[events[i].shortName])
                                  }
                              }
                          }
  
                          return this[m] // chaining event & method
                      };
  
  
                      // var func = function () {
                      //
                      //     // retrieving local arguments, & binding it to the event callback
                      //
                      //     cached.apply(this[m], arguments);
                      //
                      //     this[m].onComplete = function (cb) {
                      //
                      //         console.debug('setting listener for: [ ' + self.model + '/' + events[i].entityName + '::' + events[i].shortName + ' ]');
                      //
                      //         //Setting local listener : normal case
                      //         if (entity._triggers.indexOf(events[i].shortName) > -1) {
                      //
                      //             if (typeof(entity._arguments) == 'undefined' || typeof(entity._arguments) != 'undefined' && typeof(entity._arguments[events[i].shortName]) == 'undefined') {
                      //                 entity.once(events[i].shortName, function () { // cannot be `entity.on` for prod/stage
                      //                     // check if not already fired
                      //                     if (entity._callbacks[events[i].shortName])
                      //                         cb.apply(this[m], arguments);
                      //                 });
                      //
                      //                 // backing up callback
                      //                 entity._callbacks[events[i].shortName] = cb;
                      //             } else { // in case the event is not ready yet
                      //                 cb.apply(entity[m], entity._arguments[events[i].shortName])
                      //             }
                      //         }
                      //     }
                      //
                      //     return this[m] // chaining event & method
                      // };
                      //
                      // var funcStr = func.toString();
                      // var first   = funcStr.indexOf('{') + 1
                      // var last    = funcStr.lastIndexOf('}') -1;
                      //
                      // funcStr = funcStr.substring(first, last);
                      //
                      // return new Function(variables, funcStr)
  
                  }(events[i].shortName, f, i, fSource));
  
                  // just for display purpose: will be overriden by the previous code
                  entity[f].onComplete = function (cb) {}
  
              }
          }
  
  
          if (!/Entity$/.test(entityName)) {
              entityName = entityName + 'Entity'
          }
  
          if (caller) {
              if ( !EntitySuper[caller].instance ) {
                  EntitySuper[caller].instance = {
                      _relations: {}
                  }
              }
  
          } else {
              if ( !EntitySuper[self.name].instance ) {
                  EntitySuper[self.name].instance = {
                      _relations: {}
                  }
              }
          }
  
          if (caller) {
              EntitySuper[caller].instance._relations[entity.name] = merge(EntitySuper[caller].instance._relations[entity.name], entity);
              modelUtil.updateModel(self.bundle, self.model, entityName, EntitySuper[caller].instance._relations[entity.name] );
  
              self._relations[entity.name] = EntitySuper[caller].instance._relations[entity.name];
  
              return EntitySuper[caller].instance._relations[entity.name]
          } else {
              modelUtil.updateModel(self.bundle, self.model, entityName, entity);
              EntitySuper[self.name].instance = entity;
  
              return EntitySuper[self.name].instance
          }
      }