Mitchell Simoens commented on my Sencha thread with this:
The getter methods are generated for you and not really something that can be easily overridden. For HasMany, it's generated in the createStore, for HasOne/BelongsTo is in the createGetter. Both these methods return a function which makes it difficult to override to add a log or custom code.
So my coworker and I created "private" getter names, and used them only in that model, like this:
hasOne: [
{associationKey: 'standard', getterName: '_getStandardModel', model: 'Standard'}
],
hasMany: [
{associationKey: 'services', name: '_getServicesStore', model: 'Services'}
],
/**
* Getter: returns the associations' Standard model
* @return {Standard} standardModel
*/
getStandardModel: function() {
var standardModel = this._getStandardModel();
if (!standardModel) {
this.logError('standardModel is undefined');
}
return standardModel ;
},
/**
* Getter: returns the associations' Services store
* @return {Services} servicesStore
*/
getServicesStore: function() {
var servicesStore = this._getServicesStore();
if (!servicesStore) {
this.logError('servicesStore is undefined');
}
return servicesStore ;
}
We figured this was the best practice for our use.