File tree Expand file tree Collapse file tree 2 files changed +5
-9
lines changed
Expand file tree Collapse file tree 2 files changed +5
-9
lines changed Original file line number Diff line number Diff line change 171171}
172172
173173// List all faq attachments
174+ $ attachmentList = [];
174175if ($ faqConfig ->get ('records.disableAttachments ' ) && 'yes ' == $ faq ->faqRecord ['active ' ]) {
175176 try {
176177 $ attList = AttachmentFactory::fetchByRecordId ($ faqConfig , $ faqId );
Original file line number Diff line number Diff line change @@ -124,16 +124,11 @@ public function setCategoryTree(
124124 public function getCategoryTree (array $ categories , int $ parentId = 0 ): array
125125 {
126126 $ result = [];
127- $ stack = [[$ parentId , &$ result ]];
128127
129- while (!empty ($ stack )) {
130- list ($ currentParentId , &$ currentResult ) = array_pop ($ stack );
131-
132- foreach ($ categories as $ category ) {
133- if ((int ) $ category ['parent_id ' ] === $ currentParentId ) {
134- $ currentResult [$ category ['category_id ' ]] = [];
135- $ stack [] = [$ category ['category_id ' ], &$ currentResult [$ category ['category_id ' ]]];
136- }
128+ foreach ($ categories as $ category ) {
129+ if ((int )$ category ['parent_id ' ] === $ parentId ) {
130+ $ childCategories = $ this ->getCategoryTree ($ categories , (int )$ category ['category_id ' ]);
131+ $ result [$ category ['category_id ' ]] = $ childCategories ;
137132 }
138133 }
139134
You can’t perform that action at this time.
0 commit comments