|
@@ -15,22 +15,22 @@
|
15
|
15
|
|
16
|
16
|
luNotificationsBusiness.EVENT_DELETE = 'EVENT_DELETE';
|
17
|
17
|
|
18
|
|
- luNotificationsBusiness.businesses = {};
|
|
18
|
+ luNotificationsBusiness.dataAccesses = {};
|
19
|
19
|
|
20
|
20
|
|
21
|
21
|
function callbackWrapper(callback) {
|
22
|
22
|
return function (eventName, entityType, oldEntity, newEntity) {
|
23
|
|
- var business = luNotificationsBusiness.businesses[entityType];
|
24
|
|
- if (business != null && business.initDbo != null) {
|
25
|
|
- oldEntity = business.initDbo(oldEntity);
|
26
|
|
- newEntity = business.initDbo(newEntity);
|
|
23
|
+ var dataAccess = luNotificationsBusiness.dataAccesses[entityType];
|
|
24
|
+ if (dataAccess != null && dataAccess.initDbo != null) {
|
|
25
|
+ oldEntity = dataAccess.initDbo(oldEntity, dataAccess.TYPE_MODEL);
|
|
26
|
+ newEntity = dataAccess.initDbo(newEntity, dataAccess.TYPE_MODEL);
|
27
|
27
|
}
|
28
|
28
|
return callback(eventName, entityType, oldEntity, newEntity);
|
29
|
29
|
};
|
30
|
30
|
}
|
31
|
31
|
|
32
|
|
- luNotificationsBusiness.init = function (businesses) {
|
33
|
|
- luNotificationsBusiness.businesses = businesses;
|
|
32
|
+ luNotificationsBusiness.init = function (dataAccesses) {
|
|
33
|
+ luNotificationsBusiness.dataAccesses = dataAccesses;
|
34
|
34
|
luNotificationsDataAccess.init();
|
35
|
35
|
};
|
36
|
36
|
|