コード例 #1
0
 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');
     }
 }
コード例 #2
0
ファイル: ValueList.php プロジェクト: blackskaarj/webgr
 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;
 }