cakePHP

Last-modified: 2015-06-23 (火) 10:59:02
	/*
	 *
	 */
public function beforeValidate($options = array()) {
	// integerのフィールドのみ全角数字を半角数字に置き換える
    $columnTypes = $this->getColumnTypes();
    foreach ($this->data[$this->alias] as $field => $value) {
        if (!empty($value) && $columnTypes[$field] === 'integer') {
            $this->data[$this->alias][$field] = mb_convert_kana($value, 'n', 'UTF-8');
        }
    }
    return true;

}