# Ein Attribut in s\_order\_attributes zurücksetzen

**URL:** <https://forum.shopware.com/t/ein-attribut-in-s-order-attributes-zurucksetzen/72412>\
**Category:** Programmierung\
**Created:** [29. Januar 2021 um 11:30 UTC](https://forum.shopware.com/t/ein-attribut-in-s-order-attributes-zurucksetzen/72412 "2021-01-29T11:30:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![magnolia4](https://avatars.discourse-cdn.com/v4/letter/m/b9e5f3/32.png) [@magnolia4](https://forum.shopware.com/u/magnolia4)\
**Post date:** [29. Januar 2021 um 11:30 UTC](https://forum.shopware.com/t/ein-attribut-in-s-order-attributes-zurucksetzen/72412/1 "2021-01-29T11:30:16Z")

</div>

Wir haben das so gelöst aber ist das auch der performanteste Weg?:

```
// Clear all attributes
$orderAttributeModel = Shopware()->Models()->getRepository('Shopware\Models\Attribute\Order')->findAll();

/** @var \Shopware\Models\Attribute\Order $orderAttributeModelItem */
foreach ($orderAttributeModel as $orderAttributeModelItem) {
         $orderAttributeModelItem->setAttrOrderTest(0);
         Shopware()->Models()->persist($orderAttributeModelItem);
         Shopware()->Models()->flush();
}

```

&nbsp;
