getDefaultData(); } return [ 'id_ws_customhtml_group' => (int) $block->id_ws_customhtml_group, 'title' => $block->title, 'type' => $block->type, 'show_title' => (bool) $block->show_title, 'content' => $block->content, 'faqs' => $this->loadFaqs((int) $id), 'active' => (bool) $block->active, ]; } public function getDefaultData() { return [ 'id_ws_customhtml_group' => 0, 'title' => '', 'type' => 'html', 'show_title' => false, 'content' => '', 'faqs' => [], 'active' => true, ]; } private function loadFaqs(int $idBlock): array { return array_map(static function (array $faq) { return [ 'question' => $faq['question'], 'answer' => $faq['answer'], ]; }, CustomHtmlFaq::getByBlockId($idBlock)); } }