public function showAction() { $this->view->atDeId = $this->atDeId; $this->view->atDeName = Default_SimpleQuery::getAttributeName($this->atDeId); if (Default_ReferenceQuery::hasValueListData($this->atDeId)) { $table = new ValueList(); $select = $table->select(); $select->where(ValueList::COL_ATTRIBUTE_DESCRIPTOR_ID . "= ?", $this->atDeId, 'int'); $rowset = $table->fetchAll($select); $array = $rowset->toArray(); $this->view->list = $array; $this->render('list'); } }
public static function getCommaSeperatedValueList($atDeId) { $list = ''; if (Default_ReferenceQuery::hasValueListData($atDeId)) { $db = Zend_Db_Table_Abstract::getDefaultAdapter(); $select = $db->select(); $select->from(self::TABLE_NAME, self::COL_NAME)->where(ValueList::COL_ATTRIBUTE_DESCRIPTOR_ID . "= ?", $atDeId, 'int'); $listArray = $db->fetchAll($select); if (is_array($listArray)) { foreach ($listArray as $index => $arrayValue) { if ($index == count($listArray) - 1) { $list = $list . $arrayValue[self::COL_NAME]; } else { if ($index != 0 && $index % 5 == 0) { $list = $list . '<br />' . $arrayValue[self::COL_NAME] . ', '; } else { $list = $list . $arrayValue[self::COL_NAME] . ', '; } } } } } return $list; }