/* ---------------------------------------------------------------------------- plan_solutions ---------------------------------------------------------------------------- */ public function getPlanCategoryAndSolutions() { $categories = $this->builderPlanCategories->orderBy('weight', 'ASC') ->getWhere(['title !=' => 'gemeinsam genutzte Sicherheitseinrichtungen']) ->getResultArray(); $solutions = $this->builderPlanSolutions->get()->getResultArray(); foreach($categories as $key => $category) { for($i = 0; $i < count($solutions); $i++) { if($category['pc_id'] == $solutions[$i]['category_id']) { $categories[$key]['solutions'][] = $solutions[$i]; } } } return $categories; }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter