# Frage über die Update() funktion

**URL:** <https://forum.shopware.com/t/frage-uber-die-update-funktion/37235>\
**Category:** Programmierung\
**Created:** [4. Juni 2016 um 16:40 UTC](https://forum.shopware.com/t/frage-uber-die-update-funktion/37235 "2016-06-04T16:40:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vergil21](https://avatars.discourse-cdn.com/v4/letter/v/e274bd/32.png) [@Vergil21](https://forum.shopware.com/u/Vergil21)\
**Post date:** [4. Juni 2016 um 16:40 UTC](https://forum.shopware.com/t/frage-uber-die-update-funktion/37235/1 "2016-06-04T16:40:05Z")

</div>

Ich hab&nbsp;ein paar&nbsp;änderungen auf&nbsp;mein alten&nbsp;plugin hinzugefügt und hab jetzt eine neue version. Es gibt im groben&nbsp;2 Änderungen:

1- In meinen NEUEN plugin hab ich 2&nbsp;neue&nbsp;elemente:&nbsp;

> $form-\>setElement(‚text‘, ‚antwort1‘,&nbsp;  
> &nbsp; &nbsp; &nbsp; &nbsp; array(  
> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ‚label‘ =\> ‚Antwort 1‘,  
> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ‚description‘ =\> ‚Text feld 1‘,  
> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ‚required‘ =\> true  
> &nbsp; &nbsp; &nbsp; &nbsp; ));
> 
> $form-\>setElement(‚text‘, ‚antwort2‘,&nbsp;  
> &nbsp; &nbsp; &nbsp; &nbsp; array(  
> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ‚label‘ =\> ‚Antwort 2‘,  
> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ‚description‘ =\> ‚Text feld 2‘,  
> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ‚required‘ =\> true  
> &nbsp; &nbsp; &nbsp; &nbsp; ));

2- Dazu,&nbsp;hab ich eine NEUE&nbsp;definition für die&nbsp;„createTranslations()“ funktion hinzugefügt; Die function ubersetz die form elemente auf Englisch

In mein ALTES plugin, die „Install()“&nbsp;funktion sah&nbsp;so aus:

> public function install(){
> 
> &nbsp;$this-\>subscribeEvent(…); //selebn events
> 
> &nbsp; &nbsp; &nbsp; &nbsp; $this-\>createConfig();// 2 form elemente fehlen in den alten plugin  
> &nbsp; &nbsp; &nbsp; &nbsp; $this-\>createTranslations();// eine alte definition
> 
> &nbsp;
> 
> return true;
> 
> }

Also, meine frage bitte ist wie soll&nbsp;meine&nbsp;Update funktion aussehen?
