_title = $data['title']; $this->_entries = array(); $this->_toc = array(); parent::toArray($data['entry']); $count = 1; foreach ($data['entry'] as $key => $value) { $qa = new QAEntry($value, $section_number, $count++, $xref); $this->_entries[] = $qa; $this->_toc[$qa->getHref()] = $qa->getQuestion(); } } /* Get the title of this section. */ public function getTitle() { return $this->_title; } /* 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; } }