public function set($inputData, $two = null) { // 入力チェック用にフィールドを作成 if (!empty($inputData['zip_code1']) || !empty($inputData['zip_code2'])) { $inputData['zip_code'] = $inputData['zip_code1'] . $inputData['zip_code2']; } // 入力チェック用に条件を削除 if (empty($inputData['pref']) && empty($inputData['city']) && empty($inputData['address_opt1']) && empty($inputData['address_opt2'])) { $this->validator()->remove('pref', 'notEmpty'); $this->validator()->remove('city', 'notEmpty'); $this->validator()->remove('address_opt1', 'notEmpty'); $this->validator()->remove('address_opt2', 'notEmpty'); } // 入力チェック用にフィールドを作成 if (!empty($inputData['tel1']) || !empty($inputData['tel2']) || !empty($inputData['tel3'])) { $inputData['tel'] = $inputData['tel1'] . $inputData['tel2'] . $inputData['tel3']; } // 入力チェック用にフィールドを作成 if (!empty($inputData['fax1']) || !empty($inputData['fax2']) || !empty($inputData['fax3'])) { $inputData['fax'] = $inputData['fax1'] . $inputData['fax2'] . $inputData['fax3']; } // 入力チェック用にフィールドを作成 if (!empty($inputData['mobile_tel1']) || !empty($inputData['mobile_tel2']) || !empty($inputData['mobile_tel3'])) { $inputData['mobile_tel'] = $inputData['mobile_tel1'] . $inputData['mobile_tel2'] . $inputData['mobile_tel3']; } // 入力チェック用にパラメータを設定 parent::set($inputData, $two); }
public function set($inputData, $two = null) { // 配列だったら戻る if (!is_array($inputData)) { // 入力された値によって、バリデータを変更 // もし、期間フラグが立っていたら、開始日と終了日の整合性と日付かどうかをチェックする。 if ($inputData['term_flg'] === '1' && $inputData['coupon_type'] === '0') { $this->validate['start_datetime'] = array('notEmpty' => array('rule' => 'notEmpty', 'message' => '開始日を設定してください。'), 'date' => array('rule' => array('date', 'ymd'), 'message' => '開始日を正しく指定してください。')); $this->validate['end_datetime'] = array('notEmpty' => array('rule' => 'notEmpty', 'message' => '終了日を設定してください。'), 'date' => array('rule' => array('date', 'ymd'), 'message' => '終了日を正しく指定してください。')); } // もし、クーポンの種類が期間限定の時は、表示日数が必須で、かつ数値入力になっているか確認 if ($inputData['coupon_type'] === '1') { $this->validate['display_days'] = array('notEmpty' => array('rule' => 'notEmpty', 'message' => '掲載期間を設定してください。'), 'numeric' => array('rule' => 'numeric', 'message' => '掲載期間は数値で入れてください。')); } } // 入力チェック用にパラメータを設定 parent::set($inputData, $two); }
public function set($inputData, $two = null) { // 入力チェック用にパラメータを設定 parent::set($inputData, $two); }