# ExtJs Model Association erweitern

**URL:** https://forum.shopware.com/t/extjs-model-association-erweitern/58718
**Category:** Programmierung
**Created:** [22. März 2019 um 09:14 UTC](https://forum.shopware.com/t/extjs-model-association-erweitern/58718 "2019-03-22T09:14:36Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![lkraemer](https://avatars.discourse-cdn.com/v4/letter/l/9e8a1a/32.png) [@lkraemer](https://forum.shopware.com/u/lkraemer)
#### Post date: [22. März 2019 um 09:14 UTC](https://forum.shopware.com/t/extjs-model-association-erweitern/58718/1 "2019-03-22T09:14:36Z")

</div>

Hi zusammen,

ich möchte gerne eine Association in dem Emotion-Model hinzufügen. Bisherige Teile (Fenster, etc.) konnte man ja über Ext.define und override lösen. Hat auch alle prima geklappt. Beim Model gibt es jedoch einen Fehler:

```
TypeError: this.types[h.ownerModel].prototype.associations.add is not a function

```

Hat da jemand einen Rat? Auf der Dokumentation bvon ExtJs und im Internet habe ich mich schon dumm und dämlich gesucht.

&nbsp;

Edit: Das Override-Model sieht so aus (und wird auch geladen ;)):

```
//{block name="backend/emotion/model/emotion" append}
Ext.define('Shopware.apps.Emotion.model.EmotionLws', {
    override: 'Shopware.apps.Emotion.model.Emotion',

    associations: [
        { type: 'hasMany', model: 'Shopware.apps.Emotion.model.EmotionElement', name: 'getElements', associationKey: 'elements'},
        { type: 'hasMany', model: 'Shopware.apps.Emotion.model.EmotionShop', name:'getShops', associationKey:'shops'},
        { type: 'hasMany', model: 'Shopware.apps.Emotion.model.Region', name:'getRegions', associationKey:'regions'},
    ],
});
//{/block}

```

Viele Grüße

Lars
