# Strins-Array aus einer Entity Collection erstellt?String-Array aus einer Entitätssammlung erstellt?

**URL:** <https://forum.shopware.com/t/strins-array-aus-einer-entity-collection-erstellt-string-array-aus-einer-entitaetssammlung-erstellt/99471>\
**Category:** Shopware 6 (German)\
**Tags:** general, programming, templates--design, other, themes--design, offizielle-shopware-\
**Created:** [26. April 2023 um 20:25 UTC](https://forum.shopware.com/t/strins-array-aus-einer-entity-collection-erstellt-string-array-aus-einer-entitaetssammlung-erstellt/99471 "2023-04-26T20:25:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shopwarer1638](https://avatars.discourse-cdn.com/v4/letter/s/76d3ee/32.png) [@shopwarer1638](https://forum.shopware.com/u/shopwarer1638)\
**Post date:** [26. April 2023 um 20:25 UTC](https://forum.shopware.com/t/strins-array-aus-einer-entity-collection-erstellt-string-array-aus-einer-entitaetssammlung-erstellt/99471/1 "2023-04-26T20:25:46Z")

</div>

Kann jemand einen Rat geben, wie man ein String-Array aus einer Entitätssammlung erstellt?

$properties1 = $this-\>propertyRepository-\>search($criteria1, $context);

---

<div class="post-metadata">

**Author:** ![shopwarer1638](https://avatars.discourse-cdn.com/v4/letter/s/76d3ee/32.png) [@shopwarer1638](https://forum.shopware.com/u/shopwarer1638)\
**Post date:** [27. April 2023 um 13:28 UTC](https://forum.shopware.com/t/strins-array-aus-einer-entity-collection-erstellt-string-array-aus-einer-entitaetssammlung-erstellt/99471/2 "2023-04-27T13:28:12Z")

</div>

Ich bin in der Lage, dies mit json\_encode zu tun:

```auto
$properties1 = $this
    ->propertyRepository
    ->search($criteria1, $context);

$input1 = array ($properties1->getEntities()->getElements());
$input2 = array (json_encode($input1));

$event->getContext()->addExtension('Properties1Extension1', new ArrayEntity($input2));

```

Result:

```auto
Shopware\Core\Framework\Struct\ArrayEntity {#10202 ▼
  #data: array:1 [▼
    0 => "[{"001695276a734b7c9f4b60171e1de25f":{"groupId":"2e03e57ed43942f8ace73424f4b7428b","name":"What I need to get","position":1,"colorHe ▶"
  ]
  #_entityName: "array-entity"

```

Aber ich muss ‚OR‘-Operatoren zwischen die Werte und die Ausgabe als String setzen. Und ich schaffe es nicht, dass implode damit funktioniert:

```auto
$input2 = array (implode(", ", $input1));

```

Kennt jemand die Lösung?
