title = $data['title']; $this->entries = array(); $this->toc = array(); parent::toArray($data['entry']); $count = 1; foreach ($data['entry'] as $key => $value) { $qa = new FaqEntry($value, $section_number, $count++, $xref); $this->entries[] = $qa; $this->toc[$qa->getHref()] = $qa->getQuestion(); } } /* Get a list with all question-answer entries for this section. */ public function getEntries() { return $this->entries; } /* Get the table of contents for this section. */ public function getTOC() { return $this->toc; } }