getDefaultData(); } return [ 'id_ws_customhtml_group' => (int) $block->id_ws_customhtml_group, 'title' => $block->title, 'type' => $block->type, 'show_title' => (bool) $block->show_title, 'custom_class' => $block->custom_class, 'content' => $block->content, 'image' => null, 'description' => $block->description, 'extra_description' => $block->extra_description, 'link' => $block->link, 'alert_type' => $block->alert_type, 'timeout' => (int) $block->timeout, 'faqs' => $this->loadFaqs((int) $id), 'active' => (bool) $block->active, ]; } public function getDefaultData() { return [ 'id_ws_customhtml_group' => 0, 'title' => '', 'type' => 'html', 'show_title' => false, 'custom_class' => '', 'content' => '', 'image' => null, 'description' => '', 'extra_description' => '', 'link' => '', 'alert_type' => 'info', 'timeout' => 0, '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)); } }