# Cannot redeclare Shopware\\Models\\Attribute\\Site::getId()

**URL:** <https://forum.shopware.com/t/cannot-redeclare-shopware-models-attribute-site-getid/31769>\
**Category:** Installation/Einstieg\
**Created:** [29. Oktober 2015 um 10:12 UTC](https://forum.shopware.com/t/cannot-redeclare-shopware-models-attribute-site-getid/31769 "2015-10-29T10:12:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tigersoft](https://avatars.discourse-cdn.com/v4/letter/t/71c47a/32.png) [@Tigersoft](https://forum.shopware.com/u/Tigersoft)\
**Post date:** [29. Oktober 2015 um 10:12 UTC](https://forum.shopware.com/t/cannot-redeclare-shopware-models-attribute-site-getid/31769/1 "2015-10-29T10:12:31Z")

</div>

Fehler im Update auf 5.1.1 Fatal error: Cannot redeclare Shopware\Models\Attribute\Site::getId() in /…/services/www/html/var/cache/production\_201510221322/doctrine/attributes/Site.php on line 72 Eine Prüfung der Datei zeigt schnell, dass sie tatsächlich fehlerhaft ist, die Funktionen getID und setID sind doppelt vorhanden: `class Site extends ModelEntity { /\*\* \* @var integer $id \* @ORM\Id \* @ORM\GeneratedValue(strategy="IDENTITY") \* @ORM\Column(name="id", type="integer", nullable=false) \*/ protected $id; /\*\* \* @var integer $Id \* \* @ORM\Column(name="cmsStaticID", type="integer", nullable=true) \*/ protected $Id; public function getId() { return $this-\>id; } public function setId($id) { $this-\>id = $id; return $this; } public function getId() { return $this-\>id; } public function setId($id) { $this-\>id = $id; return $this; } public function get() { return $this-\>; } public function set($) { $this-\> = $; return $this; } }` in 5.1.0 sah die Datei noch so aus: `class Site extends ModelEntity { /\*\* \* @var integer $id \* @ORM\Id \* @ORM\GeneratedValue(strategy="IDENTITY") \* @ORM\Column(name="id", type="integer", nullable=false) \*/ protected $id; /\*\* \* @var integer $siteId \* \* @ORM\Column(name="cmsStaticID", type="integer", nullable=true) \*/ protected $siteId; /\*\* \* @var \Shopware\Models\Site\Site \* \* @ORM\OneToOne(targetEntity="Shopware\Models\Site\Site", inversedBy="attribute") \* @ORM\JoinColumns({ \* @ORM\JoinColumn(name="cmsStaticID", referencedColumnName="id") \* }) \*/ protected $site; public function getId() { return $this-\>id; } public function setId($id) { $this-\>id = $id; return $this; } public function getSiteId() { return $this-\>siteId; } public function setSiteId($siteId) { $this-\>siteId = $siteId; return $this; } public function getSite() { return $this-\>site; } public function setSite($site) { $this-\>site = $site; return $this; }`

---

<div class="post-metadata">

**Author:** ![Heiner\_Lohaus](https://avatars.discourse-cdn.com/v4/letter/h/b5a626/32.png) [@Heiner\_Lohaus](https://forum.shopware.com/u/Heiner_Lohaus)\
**Post date:** [29. Oktober 2015 um 11:06 UTC](https://forum.shopware.com/t/cannot-redeclare-shopware-models-attribute-site-getid/31769/2 "2015-10-29T11:06:15Z")

</div>

Hi, wahrscheinlich passen die Foreign Keys nicht bzw. sind doppelt. Führe einmal das aus: [http://community.shopware.com/Foreign-K … l\_954.html](http://community.shopware.com/Foreign-Keys-reparieren%5C_detail%5C_954.html) Beim Update wird der Model-Cache geleert. Das heißt aber nicht, dass das Update schuld ist. Gruß Heiner

---

<div class="post-metadata">

**Author:** ![Tigersoft](https://avatars.discourse-cdn.com/v4/letter/t/71c47a/32.png) [@Tigersoft](https://forum.shopware.com/u/Tigersoft)\
**Post date:** [29. Oktober 2015 um 15:31 UTC](https://forum.shopware.com/t/cannot-redeclare-shopware-models-attribute-site-getid/31769/3 "2015-10-29T15:31:51Z")

</div>

Danke Herr Lohaus, genau das war es.
