Ignore:
Timestamp:
2012/02/06 11:27:03 (12 years ago)
Author:
Seasoft
Message:

#1613 (ソース整形・ソースコメントの改善)

  • Zend Framework PHP 標準コーディング規約への準拠を高めた
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_12-dev/data/class/SC_SelectSql.php

    r21441 r21442  
    5050        if ($mode == 2) { 
    5151            $this->sql .= $this->order; 
    52         }elseif ( $mode != 1 ){ 
     52        } elseif ($mode != 1) { 
    5353            $this->sql .= $this->order . " " .$this->limit ." ". $this->offset; 
    5454        } 
     
    6767 
    6868        // ある単位のみ検索($from = $to) 
    69         if ($from == $to ) { 
     69        if ($from == $to) { 
    7070            $this->setWhere( $column ." = ?" ); 
    7171            $return = array($from); 
    7272        // ~$toまで検索 
    73         } elseif (strlen($from) == 0 && strlen($to) > 0 ) { 
     73        } elseif (strlen($from) == 0 && strlen($to) > 0) { 
    7474            $this->setWhere( $column ." <= ? "); 
    7575            $return = array($to); 
    7676        // ~$from以上を検索 
    77         } elseif (strlen($from) > 0 && strlen($to) == 0 ) { 
     77        } elseif (strlen($from) > 0 && strlen($to) == 0) { 
    7878            $this->setWhere( $column ." >= ? "); 
    7979            $return = array($from); 
     
    102102 
    103103        // 開始期間だけ指定の場合 
    104         if (( $from_year != "" ) && ( $from_month != "" ) && ( $from_day != "" ) && ( $to_year == "" ) && ( $to_month == "" ) && ( $to_day == "" ) ) { 
     104        if (( $from_year != "" ) && ( $from_month != "" ) && ( $from_day != "" ) && ( $to_year == "" ) && ( $to_month == "" ) && ( $to_day == "" )) { 
    105105            $this->setWhere( $column .' >= ?'); 
    106106            $return[] = $date1; 
     
    116116 
    117117        // 終了期間だけ指定の場合 
    118         if (( $from_year == "" ) && ( $from_month == "" ) && ( $from_day == "" ) && ( $to_year != "" ) && ( $to_month != "" ) && ( $to_day != "" ) ) { 
     118        if (( $from_year == "" ) && ( $from_month == "" ) && ( $from_day == "" ) && ( $to_year != "" ) && ( $to_month != "" ) && ( $to_day != "" )) { 
    119119            $this->setWhere( $column . ' < date(?)'); 
    120120            $return[] = $date2; 
     
    127127    function setItemTerm( $arr, $ItemStr ) { 
    128128 
    129         foreach ($arr as $data ) { 
    130  
    131             if (count( $arr ) > 1 ) { 
     129        foreach ($arr as $data) { 
     130 
     131            if (count( $arr ) > 1) { 
    132132                if( ! is_null( $data ) ) $item .= $ItemStr . " = ? OR "; 
    133133            } else { 
     
    147147        $item = " ${ItemStr} IS NULL "; 
    148148 
    149         if ($arr ) { 
    150             foreach ($arr as $data ) { 
     149        if ($arr) { 
     150            foreach ($arr as $data) { 
    151151                if ($data != "不明") { 
    152152                    $item .= " OR ${ItemStr} = ?"; 
     
    165165        $item = " ${ItemStr} IS NULL OR ${ItemStr} = '' "; 
    166166        $i = 1; 
    167         if ($arr ) { 
    168             foreach ($arr as $data ) { 
     167        if ($arr) { 
     168            foreach ($arr as $data) { 
    169169                if ($i == $count) break; 
    170170                $item .= " OR ${ItemStr} = ?"; 
     
    189189        $count = count( $arrWhere ); 
    190190 
    191         for ($i = 0; $i < $count; $i++ ) { 
     191        for ($i = 0; $i < $count; $i++) { 
    192192 
    193193            if( isset( $arrWhere[$i]['value'] ) ) $statement .= $arrWhere[$i]['column'] ." = " . SC_Utils_Ex::sfQuoteSmart($arrWhere[$i]['value']) ." OR "  ; 
     
    196196        $statement = "( " . rtrim( $statement, " OR " ) . " )"; 
    197197 
    198         if ($this->where ) { 
     198        if ($this->where) { 
    199199 
    200200            $this->where .= " AND " . $statement; 
     
    208208    function setWhere($where){ 
    209209        if ($where != "") { 
    210             if ($this->where ) { 
     210            if ($this->where) { 
    211211 
    212212                $this->where .= " AND " . $where; 
     
    233233    function setLimitOffset( $limit, $offset ){ 
    234234 
    235         if (is_numeric($limit) and is_numeric($offset) ) { 
     235        if (is_numeric($limit) and is_numeric($offset)) { 
    236236 
    237237            $this->limit = " LIMIT " .$limit; 
Note: See TracChangeset for help on using the changeset viewer.