# Snippet-Dateien über Plugin ändern

**URL:** https://forum.shopware.com/t/snippet-dateien-uber-plugin-andern/11021
**Category:** Shopware 3.5
**Tags:** programming
**Created:** [17. Januar 2013 um 10:53 UTC](https://forum.shopware.com/t/snippet-dateien-uber-plugin-andern/11021 "2013-01-17T10:53:51Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![hbee](https://avatars.discourse-cdn.com/v4/letter/h/f08c70/32.png) [@hbee](https://forum.shopware.com/u/hbee)
#### Post date: [17. Januar 2013 um 10:53 UTC](https://forum.shopware.com/t/snippet-dateien-uber-plugin-andern/11021/1 "2013-01-17T10:53:51Z")

</div>

Hallo, ist es möglich die Snippet-Dateien über ein Plugin zu ändern bzw. zu überschrieben? Wenn ich direkt in snippets/backen/ Änderungen vornehme sind diese ja nicht updatesicher. Vielen Dank und viele Grüße

---

<div class="post-metadata">

### Author: ![pwoerdehoff](https://avatars.discourse-cdn.com/v4/letter/p/8dc957/32.png) [@pwoerdehoff](https://forum.shopware.com/u/pwoerdehoff)
#### Post date: [20. Februar 2013 um 17:06 UTC](https://forum.shopware.com/t/snippet-dateien-uber-plugin-andern/11021/2 "2013-02-20T17:06:57Z")

</div>

Vielleicht hilft dir das hier, müsstest du halt nur entsprechend erweitern: ` namespace foobar; class SnippetHelper { protected $namespace; protected $shopID; protected $localeID; function \_\_construct($namespace, $shopID, $localeID) { $this-\>namespace = $namespace; $this-\>shopID = $shopID; $this-\>localeID = $localeID; } function add($name, $value) { $sql = "INSERT INTO s\_core\_snippets (namespace, shopID, localeID, name, value) VALUES (?, ?, ?, ?, ?)"; Shopware()-\>Db()-\>query($sql, array($this-\>namespace, $this-\>shopID, $this-\>localeID, $name, $value)); } function getByName($namespace, $name) { $sql = "SELECT \* FROM s\_core\_snippets WHERE namespace=? AND name=?"; Shopware()-\>Db()-\>query($sql, array($this-\>namespace, $name)); } function getById($id) { $sql = "SELECT \* FROM s\_core\_snippets WHERE id=?"; Shopware()-\>Db()-\>query($sql, array($id)); } function remove($id) { $sql = "DELETE FROM s\_core\_snippets WHERE id=?"; Shopware()-\>Db()-\>query($sql, array($id)); } function removeByNamespace($id) { $sql = "DELETE FROM s\_core\_snippets WHERE namespace=?"; Shopware()-\>Db()-\>query($sql, array($this-\>namespace)); } } `
