public function show($id, $langId) { $sectionSelect = new FormSection(); $select = $sectionSelect->select()->where('FS_FormID = ?', $id)->order('FS_Seq'); $sections = $sectionSelect->fetchAll($select); $cptSection = count($sections); return $cptSection; }
/** * Get data of related sections * * @access protected * @param int $formId Id of the form which this section relates. * @param int $langId * * @return array */ protected function _selectSections($formId, $langId = null) { $oSection = new FormSection(); $oSectionIndex = new FormSectionIndex(); $select = $oSection->select()->setIntegrityCheck(false)->from(array('FS' => $oSection->info('name')))->join(array('FSI' => $oSectionIndex->info('name')), 'FS.FS_ID = FSI.FSI_SectionID', 'FSI_Title')->where('FS.FS_FormID = ?', $formId); if ($langId != null) { $select->where('FSI.' . $this->_indexLanguageId . ' = ?', $langId); } $select->order('FS.FS_Seq ASC'); $sections = $oSection->fetchAll($select)->toArray(); return $sections; }