Ignore:
Timestamp:
2007/09/11 10:42:14 (17 years ago)
Author:
nanasess
Message:

リファクタリング

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/feature-module-update/data/class/batch/SC_Batch_Daily.php

    r15625 r15664  
    1515 * @version $Id$ 
    1616 */ 
    17 class SC_Batch_Daily { 
     17class SC_Batch_Daily extends SC_Batch { 
    1818 
    1919 
     
    2727 
    2828        if (!empty($argv)) { 
    29             $term = 0; 
    30             $start = 1; // 集計期間は、$start~$termの間となる。通常前日分から。 
    31             $command = false; 
    32  
    33             // 集計対象期間の取得(指定日分さかのぼる) 
    34             if (SC_Utils_Ex::sfIsInt($argv[1]) && $argv[1] <= 365) { 
    35                 $term = $argv[1]; 
    36                 $command = true; 
    37             } 
    38  
    39             // 集計開始日 
    40             if (SC_Utils_Ex::sfIsInt($argv[2]) && $argv[2] <= 365) { 
    41                 $start = $argv[2]; 
    42                 $command = true; 
    43             } 
    44  
    45             if($term > 0) { 
    46                 // 集計の開始 
    47                 $this->lfStartDailyTotal($term, $start, $command); 
    48             } 
     29            $this->execute($argv); 
     30        } 
     31    } 
     32 
     33    /** 
     34     * バッチ処理を実行する. 
     35     * 
     36     * @param mixed $argv コマンドライン引数 
     37     * @return void 
     38     */ 
     39    function execute($argv = "") { 
     40        $term = 0; 
     41        $start = 1; // 集計期間は、$start~$termの間となる。通常前日分から。 
     42        $command = false; 
     43 
     44        // 集計対象期間の取得(指定日分さかのぼる) 
     45        if (SC_Utils_Ex::sfIsInt($argv[1]) && $argv[1] <= 365) { 
     46            $term = $argv[1]; 
     47            $command = true; 
     48        } 
     49 
     50        // 集計開始日 
     51        if (SC_Utils_Ex::sfIsInt($argv[2]) && $argv[2] <= 365) { 
     52            $start = $argv[2]; 
     53            $command = true; 
     54        } 
     55 
     56        if($term > 0) { 
     57            // 集計の開始 
     58            $this->lfStartDailyTotal($term, $start, $command); 
    4959        } 
    5060    } 
Note: See TracChangeset for help on using the changeset viewer.