# Plugin eigenes Model &quot;does not exist&quot;

**URL:** <https://forum.shopware.com/t/plugin-eigenes-model-quot-does-not-exist-quot/33159>\
**Category:** Programmierung\
**Created:** [21. Dezember 2015 um 15:06 UTC](https://forum.shopware.com/t/plugin-eigenes-model-quot-does-not-exist-quot/33159 "2015-12-21T15:06:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![heikoter](https://avatars.discourse-cdn.com/v4/letter/h/779978/32.png) [@heikoter](https://forum.shopware.com/u/heikoter)\
**Post date:** [21. Dezember 2015 um 15:06 UTC](https://forum.shopware.com/t/plugin-eigenes-model-quot-does-not-exist-quot/33159/1 "2015-12-21T15:06:36Z")

</div>

Guten Tag, ich erstelle gerade ein Frontend-Plugin für die neuste Version von Shopware (5.1.1) Das Plugin habe ich mit Hilfe von diesem Tool generiert: [https://developers.shopware.com/blog/20 … cli-tools/](https://developers.shopware.com/blog/2015/09/01/generating-plugins-with-the-cli-tools/) Das Plugin enthält ein Model, welches in der Bootstrap.php auch, meines erachtens, richtig angelegt wird. ` $this-\>registerCustomModels(); $em = Shopware()-\>Models(); $tool = new \Doctrine\ORM\Tools\SchemaTool($em); $tool-\>createSchema(array( $em-\>getClassMetadata('Shopware\CustomModels\Ticket\Ticket') )); ` Wenn ich in meinem Controller das Model nutzen will: ` $ticketModel = Shopware()-\>Models()-\>getRepository('Shopware\CustomModels\Ticket\Ticket'); ` Bekomme ich folgende Fehlermeldung im Frontend (Fehlermeldung in der config.php eingeschaltet) Fatal error: Uncaught exception ‘Doctrine\Common\Persistence\Mapping\MappingException’ with message ‘Class ‘Shopware\CustomModels\Ticket\Ticket’ does not exist’ Normale Datenbankzugriffe per SQL funktionieren allerdings. Somit ist die DB Tabelle richtig. Eine Idee, was ich noch beachten muss? Danke im Voraus Heiko Ter

---

<div class="post-metadata">

**Author:** ![EikeBrandtWarneke](https://avatars.discourse-cdn.com/v4/letter/e/cdc98d/32.png) [@EikeBrandtWarneke](https://forum.shopware.com/u/EikeBrandtWarneke)\
**Post date:** [21. Dezember 2015 um 15:15 UTC](https://forum.shopware.com/t/plugin-eigenes-model-quot-does-not-exist-quot/33159/2 "2015-12-21T15:15:08Z")

</div>

Dir fehlt in der bootstrap: ` /\*\* \* Register our custom models after initialisation. \* \* @return void \*/ public function afterInit() { // register our models $this-\>registerCustomModels(); } ` Du musst Shopware bei jeder Initialisierung deines Plugins deinen namespace bekannt geben. Viele Grüße

---

<div class="post-metadata">

**Author:** ![heikoter](https://avatars.discourse-cdn.com/v4/letter/h/779978/32.png) [@heikoter](https://forum.shopware.com/u/heikoter)\
**Post date:** [22. Dezember 2015 um 09:09 UTC](https://forum.shopware.com/t/plugin-eigenes-model-quot-does-not-exist-quot/33159/3 "2015-12-22T09:09:57Z")

</div>

Stimmt. Super, vielen Dank! Jetzt läuft es.
