| @@ 182-197 (lines=16) @@ | ||
| 179 |     { | |
| 180 | $column = array_flip($column); | |
| 181 | ||
| 182 |         foreach ($input[$this->column] as $key => $value) { | |
| 183 |             if (!array_key_exists($key, $column)) { | |
| 184 | continue; | |
| 185 | } | |
| 186 | ||
| 187 | $newKey = $key.$column[$key]; | |
| 188 | ||
| 189 | /* | |
| 190 | * set new key | |
| 191 | */ | |
| 192 |             array_set($input, "{$this->column}.$newKey", $value); | |
| 193 | /* | |
| 194 | * forget the old key and value | |
| 195 | */ | |
| 196 |             array_forget($input, "{$this->column}.$key"); | |
| 197 | } | |
| 198 | } | |
| 199 | ||
| 200 | /** | |
| @@ 218-243 (lines=26) @@ | ||
| 215 | /* | |
| 216 | * foreach the field set to find the corresponding $column | |
| 217 | */ | |
| 218 |             foreach ($set as $name => $value) { | |
| 219 | /* | |
| 220 | * if doesn't have column name, continue to the next loop | |
| 221 | */ | |
| 222 |                 if (!array_key_exists($name, $column)) { | |
| 223 | continue; | |
| 224 | } | |
| 225 | ||
| 226 | /** | |
| 227 | * example: $newKey = created_atstart. | |
| 228 | * | |
| 229 | * Σ( ° △ °|||)︴ | |
| 230 | * | |
| 231 | * I don't know why a form need range input? Only can imagine is for range search.... | |
| 232 | */ | |
| 233 | $newKey = $name.$column[$name]; | |
| 234 | ||
| 235 | /* | |
| 236 | * set new key | |
| 237 | */ | |
| 238 |                 array_set($input, "{$this->column}.$index.$newKey", $value); | |
| 239 | /* | |
| 240 | * forget the old key and value | |
| 241 | */ | |
| 242 |                 array_forget($input, "{$this->column}.$index.$name"); | |
| 243 | } | |
| 244 | } | |
| 245 | } | |
| 246 | ||