Changeset 21925 for branches/version-2_12-dev/data/class/SC_FormParam.php
- Timestamp:
- 2012/06/19 16:15:24 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_12-dev/data/class/SC_FormParam.php
r21921 r21925 336 336 function getHashArray($arrKey = array()) { 337 337 $arrRet = array(); 338 foreach ($this->keyname as $ index => $keyname) {338 foreach ($this->keyname as $keyname) { 339 339 if (empty($arrKey) || in_array($keyname, $arrKey)) { 340 340 $arrRet[$keyname] = $this->getValue($keyname); … … 346 346 // DB格納用配列の作成 347 347 function getDbArray() { 348 $dbArray = array(); 348 349 foreach ($this->keyname as $index => $key) { 349 350 if ($this->input_db[$index]) { 350 $ arrRet[$key] = $this->getValue($key);351 } 352 } 353 return $ arrRet;351 $dbArray[$key] = $this->getValue($key); 352 } 353 } 354 return $dbArray; 354 355 } 355 356 … … 378 379 // フォームに渡す用のパラメーターを返す 379 380 function getFormParamList() { 381 $formParamList = array(); 380 382 foreach ($this->keyname as $index => $key) { 381 383 // キー名 382 $ arrRet[$key]['keyname'] = $key;384 $formParamList[$key]['keyname'] = $key; 383 385 // 表示名 384 $ arrRet[$key]['disp_name'] = $this->disp_name[$index];386 $formParamList[$key]['disp_name'] = $this->disp_name[$index]; 385 387 // 文字数制限 386 $ arrRet[$key]['length'] = $this->length[$index];388 $formParamList[$key]['length'] = $this->length[$index]; 387 389 // 入力値 388 $ arrRet[$key]['value'] = $this->getValue($key);389 } 390 return $ arrRet;390 $formParamList[$key]['value'] = $this->getValue($key); 391 } 392 return $formParamList; 391 393 } 392 394 … … 403 405 function getValue($keyname, $default = '') { 404 406 $ret = null; 405 foreach ($this->keyname as $ index => $key) {407 foreach ($this->keyname as $key) { 406 408 if ($key == $keyname) { 407 409 $ret = isset($this->arrValue[$key]) ? $this->arrValue[$key] : $this->arrDefault[$key]; … … 482 484 function getSearchArray($prefix = 'search_') { 483 485 $arrResults = array(); 484 foreach ($this->keyname as $ index => $key) {486 foreach ($this->keyname as $key) { 485 487 if (preg_match('/^' . $prefix . '/', $key)) { 486 488 $arrResults[$key] = $this->getValue($key); … … 497 499 */ 498 500 function getFormDispArray() { 501 $formDispArray = array(); 499 502 foreach ($this->keyname as $index => $key) { 500 503 // キー名 501 $ arrRet[$index]['keyname'] = $key;504 $formDispArray[$index]['keyname'] = $key; 502 505 // 表示名 503 $ arrRet[$index]['disp_name'] = $this->disp_name[$index];506 $formDispArray[$index]['disp_name'] = $this->disp_name[$index]; 504 507 // 文字数制限 505 $ arrRet[$index]['length'] = $this->length[$index];508 $formDispArray[$index]['length'] = $this->length[$index]; 506 509 // 入力値 507 $ arrRet[$index]['value'] = $this->getValue($key);508 } 509 return $ arrRet;510 $formDispArray[$index]['value'] = $this->getValue($key); 511 } 512 return $formDispArray; 510 513 } 511 514 … … 521 524 // $this->paramに歯抜けが存在する場合は、NULLで埋めておく。 522 525 // 最後に配列を詰める際に、全ての項目が埋まっている必要がある。 523 foreach ( $this->keyname as $key => $val) {526 foreach (array_keys($this->keyname) as $key) { 524 527 if (!isset($this->param[$key])) { 525 528 $this->param[$key] = NULL;
Note: See TracChangeset
for help on using the changeset viewer.