From 7a9bfdf7f9ecb5b6fb663b3830790c9ce0fe270b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Mon, 16 Sep 2019 22:23:02 +0200 Subject: [PATCH] Added an comment about the recursive array_merge. --- src/Repository/StructuralDBElementRepository.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Repository/StructuralDBElementRepository.php b/src/Repository/StructuralDBElementRepository.php index e96b1ec4..53bec4c1 100644 --- a/src/Repository/StructuralDBElementRepository.php +++ b/src/Repository/StructuralDBElementRepository.php @@ -59,6 +59,12 @@ class StructuralDBElementRepository extends EntityRepository $entities = $this->findBy(['parent' => $parent], ['name' => 'ASC']); + /** + * I think it is very difficult to replace this recursive array_merge, + * so if you want to change it you should have a better idea than adding each list to $result array + * and do an array_merge(...$result) at the end. + */ + foreach ($entities as $entity) { /** @var StructuralDBElement $entity */ $result[] = $entity;