diff --git a/src/CoreShop/Bundle/PimcoreBundle/CoreExtension/EmbeddedClass.php b/src/CoreShop/Bundle/PimcoreBundle/CoreExtension/EmbeddedClass.php index 855dfd0aeb..c78cf43420 100644 --- a/src/CoreShop/Bundle/PimcoreBundle/CoreExtension/EmbeddedClass.php +++ b/src/CoreShop/Bundle/PimcoreBundle/CoreExtension/EmbeddedClass.php @@ -57,6 +57,7 @@ public function getDataForEditmode($data, $object = null, $params = []) $returnData = []; + $i = 0; foreach ($data as $embeddedObject) { if (!$embeddedObject instanceof DataObject\Concrete) { continue; @@ -73,17 +74,21 @@ public function getDataForEditmode($data, $object = null, $params = []) $objectData['id'] = $embeddedObject->getId(); $objectData['general'] = [ - 'index' => $embeddedObject->getIndex(), + 'index' => ++$i, + 'o_published' => $embeddedObject->getPublished(), + 'o_key' => $embeddedObject->getKey(), + 'o_id' => $embeddedObject->getId(), + 'o_modificationDate' => $embeddedObject->getModificationDate(), + 'o_creationDate' => $embeddedObject->getCreationDate(), + 'o_classId' => $embeddedObject->getClassId(), + 'o_className' => $embeddedObject->getClassName(), + 'o_locked' => $embeddedObject->getLocked(), + 'o_type' => $embeddedObject->getType(), + 'o_parentId' => $embeddedObject->getParentId(), + 'o_userOwner' => $embeddedObject->getUserOwner(), + 'o_userModification' => $embeddedObject->getUserModification() ]; - $allowedKeys = ['o_published', 'o_key', 'o_id', 'o_modificationDate', 'o_creationDate', 'o_classId', 'o_className', 'o_locked', 'o_type', 'o_parentId', 'o_userOwner', 'o_userModification']; - - foreach (get_object_vars($embeddedObject) as $key => $value) { - if (strstr($key, 'o_') && in_array($key, $allowedKeys)) { - $objectData['general'][$key] = $value; - } - } - $returnData[] = $objectData; }