# \[gelöst\] Plugin - Neues Model erstellen

**URL:** <https://forum.shopware.com/t/gelost-plugin-neues-model-erstellen/10441>\
**Category:** Shopware 3.5\
**Tags:** programming\
**Created:** [12. Dezember 2012 um 16:43 UTC](https://forum.shopware.com/t/gelost-plugin-neues-model-erstellen/10441 "2012-12-12T16:43:04Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Net\_Inventors\_GmbH](https://avatars.discourse-cdn.com/v4/letter/n/b38774/32.png) [@Net\_Inventors\_GmbH](https://forum.shopware.com/u/Net_Inventors_GmbH)\
**Post date:** [13. Dezember 2012 um 14:33 UTC](https://forum.shopware.com/t/gelost-plugin-neues-model-erstellen/10441/3 "2012-12-13T14:33:03Z")

</div>

[color=red]EDIT: Es läuft - ein @ORM\Entity vergessen (in dem unten stehendem Code berichtigt)[/color] - Vielen Dank nochmal. Hallo Oliver, danke für die schnelle Antwort, doch leider läuft es nicht. Ich bekomme folgende Fehlermeldung: `Class Shopware\CustomModels\Article\Test is not a valid entity or mapped super class. in Doctrine/ORM/Mapping/MappingException.php on line 147` Folgende Schritte habe ich durchgeführt: Plugins/Local/Frontend/Example/Bootstrap.php ` public function install() { Shopware()-\>Db()-\>query("CREATE TABLE test ( id INT NOT NULL AUTO\_INCREMENT PRIMARY KEY )"); } public function afterInit() { $this-\>registerCustomModels(); } ` Plugins/Local/Frontend/Example/Models/Article/Test.php ` namespace Shopware\CustomModels\Article; use Shopware\Components\Model\ModelEntity, Doctrine\ORM\Mapping AS ORM, Symfony\Component\Validator\Constraints as Assert, Doctrine\Common\Collections\ArrayCollection; /\*\* \* @ORM\Entity \* @ORM\Table(name="test") \*/ class Test extends ModelEntity { /\*\* \* @ORM\Column(name="id", type="integer", nullable=false) \* @ORM\Id \* @ORM\GeneratedValue(strategy="IDENTITY") \*/ private $id; public function getId() { return $this-\>id; } public function setId($id) { $this-\>id = $id; } } ` Der Aufruf ist dann: ` $repository = Shopware()-\>Models()-\>getRepository('Shopware\CustomModels\Article\Test'); $test = $repository-\>findAll(); ` Kannst du mir veraten wo der Fehler liegt und wie ich es richtig mache? Vielen Dank im Voraus. Gruß Maximilian Stegmaier

---

_[View the full topic](https://forum.shopware.com/t/gelost-plugin-neues-model-erstellen/10441)._
