# Entity ändern

**URL:** <https://forum.shopware.com/t/entity-andern/68771>\
**Category:** Programmierung\
**Created:** [4. August 2020 um 15:51 UTC](https://forum.shopware.com/t/entity-andern/68771 "2020-08-04T15:51:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pomom](https://avatars.discourse-cdn.com/v4/letter/p/b5a626/32.png) [@pomom](https://forum.shopware.com/u/pomom)\
**Post date:** [4. August 2020 um 15:51 UTC](https://forum.shopware.com/t/entity-andern/68771/1 "2020-08-04T15:51:00Z")

</div>

Hallo,

ich habe in meinem Plugin ine eigene Datenbank-Entity erstellt (mit Definition und Collection). Ich habe es nun hinbekommen mit “repository-\>create(…)” eine neue Entity zu erstellen, wie kann ich diese Entity jedoch jetzt ändern?

&nbsp;

Ich weiß, dass ich “$entity-\>setName(…)” ausführen kann, jedoch scheinen die Änderungen hierbei ja nicht in die Datenbank geschrieben zu werden.

&nbsp;

---

<div class="post-metadata">

**Author:** ![Krispin](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/krispin/32/12849_2.png) [@Krispin](https://forum.shopware.com/u/Krispin)\
**Post date:** [5. August 2020 um 06:33 UTC](https://forum.shopware.com/t/entity-andern/68771/2 "2020-08-05T06:33:46Z")

</div>

Hi pomom,

hierfür haben die Repositories die Funktionen update oder upsert:&nbsp;[https://docs.shopware.com/en/shopware-platform-dev-en/how-to/updating-entities-dal](https://docs.shopware.com/en/shopware-platform-dev-en/how-to/updating-entities-dal)

Hoffe das hilft dir weiter.

Gruß

Krispin

---

<div class="post-metadata">

**Author:** ![pomom](https://avatars.discourse-cdn.com/v4/letter/p/b5a626/32.png) [@pomom](https://forum.shopware.com/u/pomom)\
**Post date:** [6. August 2020 um 09:15 UTC](https://forum.shopware.com/t/entity-andern/68771/3 "2020-08-06T09:15:23Z")

</div>

Vielen Dank für die Hilfe!
